home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr28 / 3c509drv.zip / 509TECH.TXT < prev    next >
Text File  |  1993-06-01  |  132KB  |  3,301 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.    3C509 and 3C509-TP Adapters
  11.  
  12.    Technical Reference Guide
  13.  
  14.    -------------------------------------------------------------------
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.    For 3Com User Group Information
  46.    1-800-NET-3Com
  47.    or your local 3Com office
  48.  
  49.    Manual Part No.  8369-00
  50.    Published March 1992.
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.    (C) Copyright 3Com Corporation, 1992.  All rights reserved.  No  part
  76.    of this manual may be reproduced in any form or by any means or  used
  77.    to make any derivative work (such as translation, transformation,  or
  78.    adaptation) without permission from 3Com Corporation.
  79.  
  80.    3Com Corporation reserves the right to revise this publication and to
  81.    make changes in content from time  to time without obligation on  the
  82.    part of 3Com Corporation to provide notification of such revision  or
  83.    change.
  84.  
  85.    3Com Corporation provides  this guide without  warranty of any  kind,
  86.    either implied or expressed,  including,  but  not  limited  to,  the
  87.    implied warranties of merchantability  and fitness  for a  particular
  88.    purpose.  3Com may  make improvements  or changes  in the  product(s)
  89.    and/or the program(s) described in this manual at any time.
  90.  
  91.    Use, duplication, or disclosure by the government shall be  expressly
  92.    subject to restrictions as set forth in subparagraph (c) (1) (ii) for
  93.    restricted Rights in Technical Data  and Computer Software clause  at
  94.    252.227-7013 of the DOD FAR Supp.
  95.  
  96.    Ask3Com and CardBoard are service marks of 3Com Corporation.
  97.  
  98.    3Com and EtherLink are registered  trademarks and EtherLink III is  a
  99.    trademark of 3Com Corporation.
  100.  
  101.    IBM  and   Personal  Computer   AT  are   registered  trademarks   of
  102.    International Business Machines Corporation.
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.            3Com 3C509 and 3C509-TP Technical Reference Guide          ii
  133.  
  134. Contents
  135.  
  136.  
  137.    Chapter 1 Introduction
  138.  
  139.    Chapter 2 Architectural Overview
  140.  
  141.    Chapter 3 Data Structures
  142.       FIFO .........................................................3-1
  143.          Receive Packet Structure ..................................3-1
  144.          Transmit Packet Structure .................................3-1
  145.  
  146.    Chapter 4 Description of Operation
  147.       Receive ......................................................4-1
  148.          Receive Packet and RX Status ..............................4-1
  149.          Receive Early .............................................4-1
  150.          Receive Complete ..........................................4-2
  151.       Transmit .....................................................4-2
  152.          Transmit Packet and Transmit Completion ...................4-2
  153.          Transmitting a Packet .....................................4-2
  154.          Transmit Underrun .........................................4-3
  155.  
  156.    Chapter 5 Window Set
  157.       Window 0 Registers - Setup ...................................5-1
  158.       Window 1 Registers - Operating Set ...........................5-2
  159.       Window 2 Registers - Station Address Setup/Read ..............5-2
  160.       Window 3 Registers - FIFO Management .........................5-3
  161.       Window 4 Registers - Diagnostics .............................5-3
  162.       Window 5 Registers - Command Results and Internal State ......5-4
  163.       Window 6 Registers - Statistics ..............................5-5
  164.  
  165.    Chapter 6 Register Definition
  166.       Command Register .............................................6-1
  167.       Status Register ..............................................6-7
  168.       FIFO Registers ...............................................6-9
  169.          RX Status .................................................6-9
  170.          TX Status .................................................6-11
  171.          RX PIO Data Read ..........................................6-12
  172.          TX PIO Data Write .........................................6-12
  173.          Free Receive Bytes ........................................6-13
  174.          Free Transmit Bytes .......................................6-13
  175.       Timer Register ...............................................6-13
  176.       Statistics Registers .........................................6-14
  177.          Statistics ................................................6-14
  178.       Diagnostic Registers .........................................6-16
  179.          Media Type and Status .....................................6-16
  180.          Net Diagnostic Port .......................................6-16
  181.          FIFO Diagnostic Port ......................................6-17
  182.          Host Diagnostic Port ......................................6-18
  183.          TX Diagnostic Port ........................................6-19
  184.          Ethernet Controller Status ................................6-19
  185.  
  186.    Chapter 7 Adapter Configuration and Enable
  187.       Automatic Configuration at Power on Reset ....................7-1
  188.       ISA Activation Mechanism .....................................7-1
  189.       EISA Activation Mechanism ....................................7-3
  190.       Window 0 Register Set ........................................7-4
  191.          Manufacturer Code Register (Read Only - Offset 0) .........7-4
  192.          Product ID Register (Read Only - Offset 2) ................7-4
  193.          Configuration Control Register (Read/Write - Offset 4) ....7-4
  194.          Address Configuration Register (Read/Write - Offset 6) ....7-5
  195.  
  196.  
  197.  
  198.            3Com 3C509 and 3C509-TP Technical Reference Guide         iii
  199.  
  200.          Resource Configuration Register (Read/Write - Offset 8) ...7-6
  201.          EEPROM Command Register (Read/Write - Offset A) ...........7-6
  202.          EEPROM Data Register (Read/Write - Offset C) ..............7-7
  203.          Command Register (Read/Write - Offset E) ..................7-7
  204.       Test Mode and "Bad" Configuration Recovery ...................7-7
  205.       EEPROM Data Structure ........................................7-8
  206.  
  207.    Chapter 8 ISA/EISA Bus Interface
  208.       Supported Slot Times and Cycle Types .........................8-1
  209.          16-bit ISA Slot ...........................................8-1
  210.          EISA Slot .................................................8-1
  211.       DC Characteristics - Pin Drive/Load Types ....................8-1
  212.       Board Edge Connector Pins ....................................8-1
  213.  
  214.    Chapter 9 External Configuration Options
  215.       Boundary Scan Configuration ..................................9-1
  216.       Forced Configuration .........................................9-1
  217.       Physical Layer Configuration .................................9-1
  218.       Physical Layer Test Access ...................................9-2
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.            3Com 3C509 and 3C509-TP Technical Reference Guide          iv
  265.  
  266. Figures
  267.  
  268.  
  269.    2-1.    Block Diagrams ..........................................2-2
  270.  
  271.    3-1.    Receive Packet Structure ................................3-1
  272.    3-2.    Transmit Packet Structure ...............................3-2
  273.  
  274.    5-1.    Setup ...................................................5-1
  275.    5-2.    Operating Set ...........................................5-2
  276.    5-3.    Station Address Setup/Read ..............................5-2
  277.    5-4.    FIFO Management .........................................5-3
  278.    5-5.    Diagnostics .............................................5-3
  279.    5-6.    Command Results and Internal State ......................5-4
  280.    5-7.    Statistics Maintained by the Adapter ....................5-5
  281.  
  282.    7-1.    ID Sequence State Machine (IDS) .........................7-1
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.            3Com 3C509 and 3C509-TP Technical Reference Guide           v
  331.  
  332. Chapter 1
  333. Introduction
  334.  
  335.  
  336.    The purpose of this document is to describe the basic architecture of
  337.    the EtherLink III (tm) Parallel  Tasking 16-bit Coax adapter  (3C509)
  338.    and the Parallel Tasking 16-bit  10BASE-T adapter (3C509-TP), and  to
  339.    serve as a reference for software and test engineers.  Aspects of the
  340.    architecture have patents pending.
  341.  
  342.    These adapters are  part of  the new  EtherLink III  family of  high-
  343.    performance  16-bit  adapters.   These  two  members  of  the  family
  344.    interface with the ISA  bus (coax and  10BASE-T).  The 3C509  adapter
  345.    includes BNC and  AUI connectors, and  the 3C509-TP adapter  includes
  346.    RJ-45 and AUI connectors.
  347.  
  348.    These adapters are software-compatible with each other, but not  with
  349.    any other 3Com (R) adapter.   This  manual  describes  both  ISA  bus
  350.    versions.
  351.  
  352.    NOTE: Unless otherwise  stated, the  name "3C509  adapter" refers  to
  353.    both the 3C509 and the 3C509-TP adapters.
  354.  
  355.    Highlights of the 3C509 adapter include:
  356.  
  357.       - The 3Com-designed Ethernet controller, encoder/decoder, 10BASE-T
  358.         transceiver, host interface,  and packet  buffer all  integrated
  359.         into one ASIC.
  360.  
  361.       - The packet buffer size is 4 K.
  362.  
  363.       - The majority of the components are surface mount.
  364.  
  365.       - The printed circuit board (PCB) is two layers.
  366.  
  367.       - High performance in client applications.
  368.  
  369.       - 16-bit data path to/from the ISA bus.
  370.  
  371.    NOTE: The 3C509 adapter is optimized to perform best in a client with
  372.    processors such as the 80286-6 MHz and above.
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.            3Com 3C509 and 3C509-TP Technical Reference Guide         1-1
  397.  
  398. Chapter 2
  399. Architectural Overview
  400.  
  401.  
  402.    The 3C509 and 3C509-TP 16-bit adapters are designed to be  efficient,
  403.    low-latency network adapters optimized for client environments.   The
  404.    emphasis on low  latency in  the design  process has  resulted in  an
  405.    adapter with only 4 K of buffer space on board, which appears as  two
  406.    dedicated 2K FIFOs to  the host.   Aspects of  the architecture  have
  407.    patents pending.
  408.  
  409.    The network transceiver  consists  of  a  dedicated  receiver  and  a
  410.    dedicated transmitter, allowing  loopback operation  at full  network
  411.    bandwidth.  At the  10BASE-T interface,  automatic polarity  reversal
  412.    and hardware link beat LED indication are supported.  At the register
  413.    level, support is provided for critical network management  functions
  414.    as well as supplementary 10BASE-T functions.
  415.  
  416.    An  integrated  encoder/decoder  and  10BASE-T  transceiver   improve
  417.    reliability while reducing the cost of the system.
  418.  
  419.    The EEPROM sets all configuration  options on the board,  eliminating
  420.    the need for  jumpers.   Methods  for  EISA  auto  configuration  are
  421.    supported.   Board  type  and  revision  number  are   electronically
  422.    readable.  Interrupt level, I/O base address, and the decode  address
  423.    of the optional remote boot PROM are among the configuration options.
  424.    A key provides security against accidental reconfiguration.
  425.  
  426.    To  facilitate  a  variety   of  platforms  and  operating   systems,
  427.    programmed I/O (PIO) is the only method of data transfer supported.
  428.  
  429.    The 4K RAM is configured  as two 2K FIFOs:  one for transmit and  one
  430.    for receive.  Various early  indication/early  start  mechanisms  are
  431.    incorporated to improve performance  and  make  operation  within  2K
  432.    possible while minimizing the likelihood of overruns or underruns.
  433.  
  434.    Interrupts can be programmed  to signal the  CPU under various  early
  435.    indication conditions, and timer mechanisms are incorporated to allow
  436.    measurement of system latencies.   These features reduce latency  and
  437.    minimize host intervention in platforms where this is appropriate.
  438.  
  439.    A high-level command interface provides for setting early indications
  440.    and managing the adapter while using only 16 bytes of I/O space.
  441.  
  442.    See Figure 2-1 for block diagrams of the 3C509 (coaxial) and 3C509-TP
  443.    (twisted-pair) adapters.
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.            3Com 3C509 and 3C509-TP Technical Reference Guide         2-1
  463.  
  464.    Twisted-pair Adapter (3C509-TP)
  465.  
  466.      +--------+
  467.      | EEPROM |
  468.      +---^----+
  469.          |
  470.  ........|.............................................................
  471.  .       |      +----------+  +------------+                          .
  472.  .       |      | 512 x 32 |  |   Network  |                          .
  473.  .       |      | RAM FIFO |  | Management |                          .
  474.  .       |      +-----^----+  +------------+                          .
  475.  .       |            |      +------------------+                     . P
  476.  .       |       +----v----+ |                  | +-------+ +-------+ . h
  477. H. +-----v-----+ |  FIFO   <-> Transmit Control <->       <->  AUI  <-->y
  478. o. |           <->Transmit | |                  | |       | +-------+ . s
  479. s. |           | +---------+ +-^------^-------^-+ |Encoder|           . i
  480. t. |           |               |      |       |   |       |           . c
  481.  . |           |               | +----v-----+ |   |       | +-------+ . a
  482. B. |   Host    |               | | Ethernet | |   |.......| |Twisted| . l
  483. u. | Interface |               | |Controller| |   |       | |  Pair <-->
  484. s. |           |               | +----^-----+ |   |       <->  Xcvr | . M
  485.  <->           |               |      |       |   |       | |       | . e
  486.  . |           | +---------+ +-v------v-------v-+ |Decoder| +-------+ . d
  487.  . |           <->  FIFO   | |                  | |       |           . i
  488.  . +-----^-----+ | Receive <->  Receive Control <->       |           . a
  489.  .       |       +----^----+ |                  | +---^---+           .
  490.  .       |            |      +------------------+     |               .
  491.  .       |      +-----v----+      +--------+          |               .
  492.  .       |      | 512 x 32 |      | Clocks |          |               .
  493.  .       |      | RAM FIFO |      +--------+          |               .
  494.  .       |      +----------+                          |         ASIC  .
  495.  ........|............................................|................
  496.          |                                            |
  497.    +-----v-----+                                   +--v--+
  498.    | Boot PROM |                                   | VCO |
  499.    +-----------+                                   +-----+
  500.  
  501.    Figure 2-1.  Block Diagrams (1 of 2)
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.            3Com 3C509 and 3C509-TP Technical Reference Guide         2-2
  529.  
  530.    Coaxial Adapter (3C509)
  531.  
  532.      +--------+
  533.      | EEPROM |
  534.      +---^----+
  535.          |
  536.  ........|.............................................................
  537.  .       |      +----------+  +------------+                          .
  538.  .       |      | 512 x 32 |  |   Network  |                          .
  539.  .       |      | RAM FIFO |  | Management |                          .
  540.  .       |      +-----^----+  +------------+                          .
  541.  .       |            |      +------------------+                     . P
  542.  .       |       +----v----+ |                  | +-------+ +-------+ . h
  543. H. +-----v-----+ |  FIFO   <-> Transmit Control <->       <->  AUI  <-->y
  544. o. |           <->Transmit | |                  | |       | +-------+ . s
  545. s. |           | +---------+ +-^------^-------^-+ |Encoder| ........... i
  546. t. |           |               |      |       |   |       | .           c
  547.  . |           |               | +----v-----+ |   |       | .+-------+  a
  548. B. |   Host    |               | | Ethernet | |   |.......| .|       |  l
  549. u. | Interface |               | |Controller| |   |       | .|Coaxial<->
  550. s. |           |               | +----^-----+ |   |       <--> Xcvr  |  M
  551.  <->           |               |      |       |   |       | .|       |  e
  552.  . |           | +---------+ +-v------v-------v-+ |Decoder| .+-------+  d
  553.  . |           <->  FIFO   | |                  | |       | .           i
  554.  . +-----^-----+ | Receive <->  Receive Control <->       | .           a
  555.  .       |       +----^----+ |                  | +---^---+ .
  556.  .       |            |      +------------------+     |     .
  557.  .       |      +-----v----+      +--------+          |     .
  558.  .       |      | 512 x 32 |      | Clocks |          |     .
  559.  .       |      | RAM FIFO |      +--------+          |     .
  560.  .       |      +----------+                   ASIC   |     .
  561.  ........|............................................|......
  562.          |                                            |
  563.    +-----v-----+                                   +--v--+
  564.    | Boot PROM |                                   | VCO |
  565.    +-----------+                                   +-----+
  566.  
  567.  
  568.    Figure 2-1.  Block Diagrams (2 of 2)
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.            3Com 3C509 and 3C509-TP Technical Reference Guide         2-3
  595.  
  596. Chapter 3
  597. Data Structures
  598.  
  599.  
  600.    The following sections describe the  data  structures  used  for  the
  601.    adapter's FIFO.
  602.  
  603.  
  604.    3.1 FIFO
  605.  
  606.    The adapter's 4 K SRAM is organized into two 512 x 32 FIFOs: one  for
  607.    transmit and one for  receive.  The size,  alignment, and padding  of
  608.    the packet stored in SRAM  are set  to double  word boundaries.   The
  609.    amount of unused space is monitored in the free byte registers:  Free
  610.    Transmit Bytes and Free Receive Bytes.
  611.  
  612.    3.1.1 Receive Packet Structure
  613.  
  614.    Figure 3-1 shows  a model of  the receive packet  structure as it  is
  615.    stored in the FIFO.
  616.  
  617.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  618.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  619.        |                                                               |
  620.        |                60 - 1514 bytes of packet data                 |
  621.        |                                                               |
  622.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  623.        |                    Padding to double word                     |
  624.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  625.        |                          Undefined                            |
  626.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  627.  
  628.    Figure 3-1.  Receive Packet Structure
  629.  
  630.  
  631.       - Packet data is contained in the first 60 to 1,514 bytes.
  632.  
  633.       - Padding to a double word (dword) boundary follows.
  634.  
  635.       - There may be additional  overhead  bytes  associated  with  each
  636.         packet that are used by the hardware but must not be read by the
  637.         host.
  638.  
  639.    The  receive  status  information  is  in  the  RX  Status  register.
  640.    Software must not read past the  end of the packet (the software  can
  641.    read padding to a dword boundary).   To progress to the next  packet,
  642.    the software must issue an  RX  Discard  command  that  discards  the
  643.    remainder of the  packet, if  any, and  pops the  current RX  Status,
  644.    replacing it with the next packet status, if any.
  645.  
  646.    3.1.2 Transmit Packet Structure
  647.  
  648.    Figure 3-2 shows a  model of the transmit  packet structure as it  is
  649.    stored in the FIFO.
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.            3Com 3C509 and 3C509-TP Technical Reference Guide         3-1
  661.  
  662.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  663.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  664.        |INT|  Unassigned   |                 Length                    |
  665.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  666.        |                          Unassigned                           |
  667.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  668.        |                                                               |
  669.        |                14 - 1514 bytes of packet data                 |
  670.        |                                                               |
  671.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  672.        |                    Padding to double word                     |
  673.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  674.  
  675.    Figure 3-2.  Transmit Packet Structure
  676.  
  677.  
  678.       - The preamble is two  words long.   The first  word contains  the
  679.         length of the  packet  in  bytes  and  the  Interrupt  (Int)  on
  680.         successful Transmit  Complete  bit  in  Bit  15.   This  bit  is
  681.         maskable in the  Interrupt Mask  register.  The  second word  is
  682.         reserved.
  683.  
  684.       - Packet data follows next 14 to 1,514 bytes.
  685.  
  686.       - Padding to a double word boundary is last.
  687.  
  688.    The packet length is measured in bytes.  If a packet length is not  a
  689.    multiple of four, pad bytes must be added to bring the packet size in
  690.    the FIFO  to a  4-byte boundary.   The packet  length, however,  must
  691.    reflect the true size  of  the  packet  (before  the  padding).   The
  692.    hardware automatically pads packets shorter than 60 bytes.
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.            3Com 3C509 and 3C509-TP Technical Reference Guide         3-2
  727.  
  728. Chapter 4
  729. Description of Operation
  730.  
  731.  
  732.    The data transfer mode for the 3C509 adapter is programmed I/O (PIO).
  733.    As data is received off the wire, it accumulates in the receive FIFO.
  734.    The driver reads the data off the adapter a byte or a word at a  time
  735.    through the PIO Data Read register.  Similarly, transmit data can  be
  736.    written to the adapter a byte or a word at a time, and it accumulates
  737.    in the transmit (TX) FIFO.  Once a packet has been transmitted out of
  738.    the TX FIFO, it is discarded and the space it consumes is available.
  739.  
  740.    The transmit and receive configurations are described below.
  741.  
  742.  
  743.    4.1 Receive
  744.  
  745.    4.1.1 Receive Packet and RX Status
  746.  
  747.    Each packet in the RX FIFO consists  of the packet data, padded to  a
  748.    dword boundary.
  749.  
  750.    The RX Status register always maintains  the status of the packet  at
  751.    the head of the  FIFO.  After using  PIO to read  the data, the  host
  752.    must issue an RX Discard command to update the RX Status register for
  753.    the next packet.
  754.  
  755.    The driver may  transfer all of  the receive data  from the FIFO  via
  756.    PIO.  The driver can take interrupts when RX Early threshold bytes of
  757.    a packet have been received,  or  when  an  entire  packet  has  been
  758.    received.
  759.  
  760.    The driver can  determine the  size of  the packet  (number of  bytes
  761.    remaining/received so far) at the head of the RX FIFO by reading  the
  762.    RX Status register.   Once the packet  has been completely  received,
  763.    any errors that occurred during reception are posted in the RX Status
  764.    register.
  765.  
  766.    4.1.2 Receive Early
  767.  
  768.    The RX Early interrupt will probably be enabled only if the  protocol
  769.    interface allows for  early  receive  indications.   However,  it  is
  770.    possible for the driver  to take the RX  Early interrupt in order  to
  771.    compute the packet size (perhaps only for 802.3 packets) and generate
  772.    the equivalent of an early RX Complete indication.
  773.  
  774.    The driver may choose to set the RX Early threshold to slightly  less
  775.    than the protocol's early lookahead size to overlap the reception  of
  776.    the final  bytes  with  the  interrupt  latency.   On  entry  to  the
  777.    interrupt handler,  the RX  Status register  can be  examined to  see
  778.    whether the threshold needs to be adjusted.
  779.  
  780.    Once RX Early has  been set, the driver  has only to acknowledge  the
  781.    interrupt and it  will not become  active again (unless  reprogrammed
  782.    higher) until RX Status is updated for the next packet.
  783.  
  784.    The driver must transfer  the data from  the RX FIFO  via PIO into  a
  785.    dedicated lookahead area to make the data accessable to the  protocol
  786.    stack.
  787.  
  788.  
  789.  
  790.  
  791.  
  792.            3Com 3C509 and 3C509-TP Technical Reference Guide         4-1
  793.  
  794.    4.1.3 Receive Complete
  795.  
  796.    If an RX  Early indication had  been given for  the packet, then  the
  797.    lookahead bytes have already been  read in.  Otherwise, they must  be
  798.    read in now, using PIO  to transfer them  to the dedicated  lookahead
  799.    area to make the data addressable to the protocol stack.
  800.  
  801.    Once a scatter descriptor  is available from  the protocol, the  data
  802.    must be copied out of the lookahead area and the RX FIFO.
  803.  
  804.  
  805.    4.2 Transmit
  806.  
  807.    PIO is the only mode of operation supported for transmit.  This  mode
  808.    is discussed in more detail below.
  809.  
  810.    4.2.1 Transmit Packet and Transmit Completion
  811.  
  812.    Each packet in the TX FIFO  consists of a transmit preamble  followed
  813.    by the transmit data padded to a dword boundary.
  814.  
  815.    The  transmit  preamble  consists  of  two  words.   The  first  word
  816.    specifies the length of  the packet in bytes,  and whether or not  to
  817.    generate an interrupt when  the packet  is transmitted  successfully.
  818.    The second word is unassigned.
  819.  
  820.    The packet length is  the actual number  of bytes in  the FIFO to  be
  821.    sent to the  wire, excluding  any padding  to double  words.  If  the
  822.    packet is less than the minimum length (60 bytes not including  CRC),
  823.    it need not be padded  by the software.   Instead, the 3C509  adapter
  824.    will pad the  packet to the  minimum length before  giving it to  the
  825.    Ethernet controller.
  826.  
  827.    The  driver  will  request   an  interrupt  on  successful   transmit
  828.    completion only if  the protocol has  requested a confirmation.   The
  829.    driver must queue up  such requests to  retrieve the protocol  handle
  830.    for the transmit confirmation.  When any Transmit Complete  interrupt
  831.    comes  in,  the  driver  examines  the  TX  Status  register.    This
  832.    completion is for the head  of the queue  if the interrupt  requested
  833.    bit is set  in TX  Status, since  transmits complete  in order.   The
  834.    driver must  serialize  this  process  to  guarantee  that  it  works
  835.    properly.
  836.  
  837.    If an error occurs while the packet is being transmitted, the adapter
  838.    always generates an interrupt and  disables the transmitter.  If  the
  839.    host determines from TX Status  that the  confirmation is  not for  a
  840.    queued request, it can  use  the  error  information  to  update  its
  841.    statistics counters.  In any case, the host must manually restart the
  842.    transmitter by issuing the TX Enable command once it has emptied  the
  843.    TX Status stack as the result of an error.
  844.  
  845.    4.2.2 Transmitting a Packet
  846.  
  847.    All data to be transmitted must be moved into the FIFO by the driver.
  848.    Multiple packets can be moved  into the FIFO as  long as the host  is
  849.    prepared to deal with running out of TX FIFO space.
  850.  
  851.    Typically the driver will copy as  much of the packet to the  adapter
  852.    as possible.  If one  or more packets precede  this one in the  FIFO,
  853.    then the FIFO can run out of space.  If this happens, the driver  can
  854.    issue the TX Available command to request an interrupt once there  is
  855.    sufficient space for the rest of the packet.
  856.  
  857.  
  858.            3Com 3C509 and 3C509-TP Technical Reference Guide         4-2
  859.  
  860.    The Set TX Available Threshold command causes the adapter to generate
  861.    an interrupt when the specified number  of bytes is available in  the
  862.    TX FIFO.  This allows the driver  to return and continue copying  the
  863.    data  later,  when  some  of  the  data  in  the  TX  FIFO  has  been
  864.    transmitted.
  865.  
  866.    When TX  Available is  used, the  possibility of  an underrun  always
  867.    exists if the interrupt latency is high enough (for example, 1 ms  on
  868.    a window switch under OS/2).  If underruns are a problem, they can be
  869.    avoided by reprogramming the  TX Start threshold  to be greater  than
  870.    the number of bytes transferred to  that point.  That way the  driver
  871.    can guarantee that the packet will not start transmitting before  the
  872.    TX Available interrupt is  serviced.  The  driver can  be written  so
  873.    that it makes  this adjustment  only when  the amount  of the  packet
  874.    copied to the FIFO  is small enough for  concern (that is, less  than
  875.    the number of bytes that  can  be  transmitted  within  the  measured
  876.    interrupt  latency),   or  the   driver  can   make  the   adjustment
  877.    semipermanently (reset on  some  timer  tick  multiple)  whenever  an
  878.    underrun occurs.
  879.  
  880.    When a packet is currently being copied to the FIFO and the  protocol
  881.    issues another transmit request,  the driver will  have to queue  the
  882.    gather descriptor.  However, this queue - the awaiting download queue
  883.    - is different  from the transmit  completion queue described  above.
  884.    The awaiting download queue is emptied and the queue entries released
  885.    by copying the data to the adapter.
  886.  
  887.    4.2.3 Transmit Underrun
  888.  
  889.    When the transmit FIFO underruns,  the 3C509 adapter will generate  a
  890.    bad CRC for the  packet.   A  Transmit  Complete  interrupt  will  be
  891.    generated to the driver, specifying a transmit underrun error.   When
  892.    the driver detects this error, it must first issue a TX Reset command
  893.    before using TX Enable to reenable the transmitter.
  894.  
  895.    Whenever the driver encounters an underrun, it takes special care  to
  896.    guarantee that the next transmit packet does not underrun by  setting
  897.    the TX Start threshold large enough  so that it does not start  until
  898.    the packet is completely  copied  to  the  adapter.   For  subsequent
  899.    packets, the driver  reacts  quickly  to  changes  in  the  operating
  900.    environment by adjusting the TX  Start  threshold  according  to  new
  901.    information on interrupt  latencies,  and  other  system  performance
  902.    measurements.  The exact mechanism used  is beyond the scope of  this
  903.    document.
  904.  
  905.    NOTE: Underruns occur only when  the packet  is being  copied to  the
  906.    adapter.  Therefore, the driver should  be  able  to  retransmit  the
  907.    packet.  Checking  for  underruns  and  retransmissions  can  greatly
  908.    reduce the performance impact of  an underrun (to  the point that  an
  909.    occasional underrun is acceptable).
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.            3Com 3C509 and 3C509-TP Technical Reference Guide         4-3
  925.  
  926. Chapter 5
  927. Window Set
  928.  
  929.  
  930.    The 3C509 adapter  register set consists  of several 8-word  register
  931.    windows.  The windows  are  numbered,  and  each  window  presents  a
  932.    different register set to the  host through the standard 16-byte  I/O
  933.    space of the adapter.  At power-up, or after a Global Reset, Window 0
  934.    is the working  register set.  Window  0 contains setup  information,
  935.    including the registers  reflecting  the  EEPROM  setup  information.
  936.    Window 1 contains the  standard register set.   This includes all  of
  937.    the registers used on the  driver  critical  path.   Accessing  other
  938.    windows will require switching away  and back in a critical  section.
  939.    The driver will switch to  Window 1 during initialization and  assume
  940.    that this set is always  current from that  point on.  Other  windows
  941.    contain the statistics information,  report the adapter state,  allow
  942.    for reconfiguration, and support various diagnostics.
  943.  
  944.  
  945.    5.1 Window 0 Registers - Setup
  946.  
  947.    This window contains  configuration registers,  including EISA  setup
  948.    and EEPROM access.
  949.  
  950. Port
  951. Indx  Write Function                    Read Function
  952. ----  --------------                    -------------
  953.  
  954.       1 1 1 1 1 1                       1 1 1 1 1 1
  955.       5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0   5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  956.      +-------------------------------+ +-----+-------------------------+
  957.  0E  | Command                       | | Win |       Status            |
  958.      +-------------------------------+ +-----+-------------------------+
  959.  0C  | EEPROM Data                   | | EEPROM Data                   |
  960.      +-------------------------------+ +-------------------------------+
  961.  0A  | EEPROM Command                | | EEPROM Command                |
  962.      +-------------------------------+ +-------------------------------+
  963.  08  | Resource Configuration        | | Resource Configuration        |
  964.      +-------------------------------+ +-------------------------------+
  965.  06  | Address Configuration         | | Address Configuration         |
  966.      +-------------------------------+ +-------------------------------+
  967.  04  | Configuration Control         | | Configuration Control         |
  968.      +-------------------------------+ +-------------------------------+
  969.  02  | Adapter ID                    | | Adapter ID                    |
  970.      +-------------------------------+ +-------------------------------+
  971.  00  |                               | | Manufacturer ID               |
  972.      +-------------------------------+ +-------------------------------+
  973.  
  974.    Figure 5-1.  Setup
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.            3Com 3C509 and 3C509-TP Technical Reference Guide         5-1
  991.  
  992.    5.2 Window 1 Registers - Operating Set
  993.  
  994.    The window set is assumed to be on critical path.  The TX Status  and
  995.    Timer registers must be read separately as byte registers.
  996.  
  997. Port
  998. Indx  Write Function                    Read Function
  999. ----  --------------                    -------------
  1000.  
  1001.       1 1 1 1 1 1                       1 1 1 1 1 1
  1002.       5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0   5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  1003.      +-------------------------------+ +-----+-------------------------+
  1004.  0E  | Command                       | | Win |       Status            |
  1005.      +-------------------------------+ +-----+-------------------------+
  1006.  0C  |                               | | Free Transmit Bytes           |
  1007.      +---------------+---------------+ +---------------+---------------+
  1008.  0A  | TxStatus      |               | | Tx Status     | Timer         |
  1009.      +---------------+---------------+ +---------------+---------------+
  1010.  08  |                               | | Rx Status                     |
  1011.      +-------------------------------+ +-------------------------------+
  1012.  06  |                               | |                               |
  1013.      +-------------------------------+ +-------------------------------+
  1014.  04  |                               | |                               |
  1015.      +-------------------------------+ +-------------------------------+
  1016.  02  | Tx PIO Data Write             | | Rx PIO Data Read              |
  1017.      +-------------------------------+ +-------------------------------+
  1018.  00  | Tx PIO Data Write             | | Rx PIO Data Read              |
  1019.      +-------------------------------+ +-------------------------------+
  1020.  
  1021.    Figure 5-2.  Operating Set
  1022.  
  1023.  
  1024.    5.3 Window 2 Registers - Station Address Setup/Read
  1025.  
  1026.    The station address must be read out of the EEPROM and written  using
  1027.    these registers before reception is enabled.
  1028.  
  1029. Port
  1030. Indx  Write Function                    Read Function
  1031. ----  --------------                    -------------
  1032.  
  1033.       1 1 1 1 1 1                       1 1 1 1 1 1
  1034.       5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0   5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  1035.      +-------------------------------+ +-----+-------------------------+
  1036.  0E  | Command                       | | Win |       Status            |
  1037.      +-------------------------------+ +-----+-------------------------+
  1038.  0C  |                               | |                               |
  1039.      +-------------------------------+ +-------------------------------+
  1040.  0A  |                               | |                               |
  1041.      +-------------------------------+ +-------------------------------+
  1042.  08  |                               | |                               |
  1043.      +-------------------------------+ +-------------------------------+
  1044.  06  |                               | |                               |
  1045.      +---------------+---------------+ +---------------+---------------+
  1046.  04  | Address 5     | Address 4     | | Address 5     | Address 4     |
  1047.      +---------------+---------------+ +---------------+---------------+
  1048.  02  | Address 3     | Address 2     | | Address 3     | Address 2     |
  1049.      +---------------+---------------+ +---------------+---------------+
  1050.  00  | Address 1     | Address 0     | | Address 1     | Address 0     |
  1051.      +---------------+---------------+ +---------------+---------------+
  1052.  
  1053.    Figure 5-3.  Station Address Setup/Read
  1054.  
  1055.  
  1056.            3Com 3C509 and 3C509-TP Technical Reference Guide         5-2
  1057.  
  1058.    5.4 Window 3 Registers - FIFO Management
  1059.  
  1060. Port
  1061. Indx  Write Function                    Read Function
  1062. ----  --------------                    -------------
  1063.  
  1064.       1 1 1 1 1 1                       1 1 1 1 1 1
  1065.       5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0   5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  1066.      +-------------------------------+ +-----+-------------------------+
  1067.  0E  | Command                       | | Win |       Status            |
  1068.      +-------------------------------+ +-----+-------------------------+
  1069.  0C  |                               | | Free Transmit Bytes           |
  1070.      +-------------------------------+ +-------------------------------+
  1071.  0A  |                               | | Free Receive Bytes            |
  1072.      +-------------------------------+ +-------------------------------+
  1073.  08  |                               | |                               |
  1074.      +-------------------------------+ +-------------------------------+
  1075.  06  |                               | |                               |
  1076.      +-------------------------------+ +-------------------------------+
  1077.  04  |                               | |                               |
  1078.      +-------------------------------+ +-------------------------------+
  1079.  02  |                               | |                               |
  1080.      +-------------------------------+ +-------------------------------+
  1081.  00  |                               | |                               |
  1082.      +-------------------------------+ +-------------------------------+
  1083.  
  1084.    Figure 5-4.  FIFO Management
  1085.  
  1086.  
  1087.    5.5 Window 4 Registers - Diagnostics
  1088.  
  1089. Port
  1090. Indx  Write Function                    Read Function
  1091. ----  --------------                    -------------
  1092.  
  1093.       1 1 1 1 1 1                       1 1 1 1 1 1
  1094.       5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0   5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  1095.      +-------------------------------+ +-----+-------------------------+
  1096.  0E  | Command                       | | Win |       Status            |
  1097.      +-------------------------------+ +-----+-------------------------+
  1098.  0C  |                               | |                               |
  1099.      +-------------------------------+ +-------------------------------+
  1100.  0A  | Media Type and Status         | | Media Type and Status         |
  1101.      +-------------------------------+ +-------------------------------+
  1102.  08  | Ethernet Controller Status    | | Ethernet Controller Status    |
  1103.      +-------------------------------+ +-------------------------------+
  1104.  06  | Net Diagnostic                | | Net Diagnostic                |
  1105.      +-------------------------------+ +-------------------------------+
  1106.  04  | FIFO Diagnostic               | | FIFO Diagnostic               |
  1107.      +-------------------------------+ +-------------------------------+
  1108.  02  | Host Diagnostic               | | Host Diagnostic               |
  1109.      +-------------------------------+ +-------------------------------+
  1110.  00  | TX Diagnostic                 | | TX Diagnostic                 |
  1111.      +-------------------------------+ +-------------------------------+
  1112.  
  1113.    Figure 5-5.  Diagnostics
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.            3Com 3C509 and 3C509-TP Technical Reference Guide         5-3
  1123.  
  1124.    5.6 Window 5 Registers - Command Results and Internal State
  1125.  
  1126.    This window contains registers  that  allow  the  parameters  set  by
  1127.    command to be read back for diagnostic purposes.
  1128.  
  1129. Port
  1130. Indx  Write Function                    Read Function
  1131. ----  --------------                    -------------
  1132.  
  1133.       1 1 1 1 1 1                       1 1 1 1 1 1
  1134.       5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0   5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  1135.      +-------------------------------+ +-----+-------------------------+
  1136.  0E  | Command                       | | Win |       Status            |
  1137.      +-------------------------------+ +-----+-------------------------+
  1138.  0C  |                               | | Read Zero Mask                |
  1139.      +-------------------------------+ +-------------------------------+
  1140.  0A  |                               | | Interrupt Mask                |
  1141.      +-------------------------------+ +-------------------------------+
  1142.  08  |                               | | RX Filter (lower 4 bits only) |
  1143.      +-------------------------------+ +-------------------------------+
  1144.  06  |                               | | RX Early Threshold            |
  1145.      +-------------------------------+ +-------------------------------+
  1146.  04  |                               | |                               |
  1147.      +-------------------------------+ +-------------------------------+
  1148.  02  |                               | | TX Available Threshold        |
  1149.      +-------------------------------+ +-------------------------------+
  1150.  00  |                               | | TX Start Threshold + 4        |
  1151.      +-------------------------------+ +-------------------------------+
  1152.  
  1153.    Figure 5-6.  Command Results and Internal State
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.            3Com 3C509 and 3C509-TP Technical Reference Guide         5-4
  1189.  
  1190.    5.7 Window 6 Registers - Statistics
  1191.  
  1192.    Reading a statistic also zeroes it.  These registers may be read only
  1193.    while  statistics   collection   has   been   disabled   temporarily.
  1194.    Statistics that are word-sized must be read as words, and those  that
  1195.    are bytes must be read as  bytes.   Writing  to  these  registers  is
  1196.    supported for debugging purposes.  Refer to "Statistics Registers" in
  1197.    Chapter 6 for more information.
  1198.  
  1199. Port
  1200. Indx  Write Function                    Read Function
  1201. ----  --------------                    -------------
  1202.  
  1203.       1 1 1 1 1 1                       1 1 1 1 1 1
  1204.       5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0   5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  1205.      +-------------------------------+ +-----+-------------------------+
  1206.  0E  | Command                       | | Win |       Status            |
  1207.      +-------------------------------+ +-------------------------------+
  1208.  0C  | Total Bytes Transmitted OK    | | Total Bytes Transmitted OK    |
  1209.      +-------------------------------+ +-------------------------------+
  1210.  0A  | Total Bytes Received OK       | | Total Bytes Received OK       |
  1211.      +---------------+---------------+ +---------------+---------------+
  1212.  08  |               | Xmit Deferrals| |               | Xmit Deferrals|
  1213.      +---------------+---------------+ +---------------+---------------+
  1214.  06  | Frames Recv OK| Frames Xmit OK| | Frames Recv OK| Frames Xmit OK|
  1215.      +---------------+---------------+ +---------------+---------------+
  1216.  04  | Recv Overruns | Late Collision| | Recv Overruns | Late Collision|
  1217.      +---------------+---------------+ +---------------+---------------+
  1218.  02  | One Collision | Multiple Coll | | One Collision | Multiple Coll |
  1219.      +---------------+---------------+ +---------------+---------------+
  1220.  00  | No SQE Xmits  | Carrier Lost  | | No SQE Xmits  | Carrier Lost  |
  1221.      +---------------+---------------+ +---------------+---------------+
  1222.  
  1223.    Figure 5-7.  Statistics Maintained by the Adapter
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.            3Com 3C509 and 3C509-TP Technical Reference Guide         5-5
  1255.  
  1256. Chapter 6
  1257. Register Definition
  1258.  
  1259.  
  1260.    The following sections describe the function and usage of each of the
  1261.    registers needed in normal  operation  of  the  3C509  adapter.   The
  1262.    adapter configuration and enable registers in Window 0 are  discussed
  1263.    in Chapter 7.
  1264.  
  1265.  
  1266.    6.1 Command Register
  1267.  
  1268.    Function:    Issues commands to adapter
  1269.    Location:    All windows/Port 0E
  1270.    Type:        Write only
  1271.    Size:        16 bits
  1272.    Bit Description:
  1273.  
  1274.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  1275.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  1276.        |    Command Code   |              Command Argument             |
  1277.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  1278.  
  1279.         Bits 15-11      5-bit code for command to be executed.
  1280.         Bits 10-0       11-bit argument if any.  For commands with no
  1281.                         arguments, these bits can be set to anything.
  1282.  
  1283.    Many adapter functions are controlled  by the Command register.   For
  1284.    example, a command is used  to  switch  windows.   Commands  must  be
  1285.    written as a  word even  if they  have no  parameters.  However,  the
  1286.    following is acceptable for commands with no parameters:
  1287.  
  1288.         mov     dx, PortCmdStatus
  1289.         mov     ah, CMD_X
  1290.         out     dx, ax
  1291.  
  1292.    Most commands execute in one  I/O cycle except  those marked with  an
  1293.    asterisk (*).  The software must poll the Command-in-Progress bit  in
  1294.    the Status register to  determine  when  one  of  these  commands  is
  1295.    completed.  Since only a  single command  may be  outstanding at  any
  1296.    given time, the host must do this in a critical section.
  1297.  
  1298.    The commands are listed below.   The 5-bit command code is  specified
  1299.    in binary  before  each  command.   If  the  command  has  an  11-bit
  1300.    argument, it is given  in parentheses following  the command name  in
  1301.    the format aaa aaaa aaaa.  Also:
  1302.  
  1303.       - An x signifies a bit in the argument.
  1304.  
  1305.       - A 0 signifies a bit that must be zero.
  1306.  
  1307.       - A z signifies either a 0 or a 1, but will be treated as a 0.
  1308.  
  1309.       - A 1 signifies either a 0 or a 1, but will be treated as a 1.
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-1
  1321.  
  1322.    00000 Global Reset (000 0000 0000)
  1323.  
  1324.    This command has  the  same  effect  as  a  power-up  reset.   It  is
  1325.    implemented with a minimum amount  of logic to ensure success.   This
  1326.    command requires a significant  amount of  time to  execute since  it
  1327.    involves rereading the EEPROM.  The  timer may not  be used for  this
  1328.    delay period.  The host  must wait at least  1 ms after issuing  this
  1329.    command before it touches  the adapter again.   The argument to  this
  1330.    command must be all zeros.
  1331.  
  1332.    00001 Select Register Window (000 0000 0xxx)
  1333.  
  1334.    This command selects  register  window  xxx.   The  current  register
  1335.    window is available in the Status register.  After power-up, Window 0
  1336.    is in effect.
  1337.  
  1338.    00010 Start Coaxial Transceiver
  1339.  
  1340.    This command affects only the 10BASE2 operation.  It starts the DC-DC
  1341.    converter that drives  the  on-board  coaxial  Ethernet  transceiver.
  1342.    After power-up, the coaxial transceiver must be started manually with
  1343.    this command.  The host must delay at least 800 us after issuing this
  1344.    command  before  using  the   coaxial  transceiver.    This  can   be
  1345.    accomplished by starting the timer and  waiting until it pegs at  its
  1346.    maximum value of FFh.  The  host must read the Address  Configuration
  1347.    register (refer  to "Address  Configuration Register"  in Chapter  7)
  1348.    from the EEPROM to determine whether to issue this command.
  1349.  
  1350.    00011 RX Disable
  1351.  
  1352.    This command disables the Ethernet controller receiver.  If a  packet
  1353.    is in the process  of being  received, it  will be  received and  the
  1354.    Ethernet controller receiver  will be disabled  after the packet  has
  1355.    been completely received.   To enable  the receiver,  use RX  Enable.
  1356.    After power-up, the receiver is in the disabled state.
  1357.  
  1358.    00100 RX Enable
  1359.  
  1360.    This command enables the Ethernet  controller receiver.  If a  packet
  1361.    is in the process of  being transmitted on the  wire, it will not  be
  1362.    received.  To disable the receiver,  use  RX  Disable  or  RX  Reset.
  1363.    After power-up, the receiver is  in the  disabled state  and must  be
  1364.    enabled with this command.
  1365.  
  1366.    00101 RX Reset (000 0000 0000)
  1367.  
  1368.    This command empties the RX  FIFO, disables the Ethernet  controller,
  1369.    resets the RX Filter and RX  Early threshold to defaults, and  aborts
  1370.    reception if a packet is currently  being received.  Do not issue  RX
  1371.    Reset unless it is absolutely required.  The argument to this command
  1372.    must be all zeros.
  1373.  
  1374.    01000 RX Discard Top Packet*
  1375.  
  1376.    This command discards the remainder of the top packet in the RX  FIFO
  1377.    (the adapter can do  this faster than the  host).  If the packet  has
  1378.    been completely received, use  the RX Status  register to update  any
  1379.    statistics before issuing this command.   If the packet has not  been
  1380.    completely received, the  adapter will  ignore the  remainder of  the
  1381.    packet as if the receiver had been disabled, then reenabled.  The  RX
  1382.    Discard pops the  current RX  Status and  replaces it  with the  next
  1383.    packet status, if any.  It is used to get from one packet to the next
  1384.    in the RX FIFO.
  1385.  
  1386.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-2
  1387.  
  1388.    The host can  also use this  command to discard  packets that are  in
  1389.    error or are not needed.  One  reason for discarding packets is  that
  1390.    they do not match any multicast address currently enabled through the
  1391.    protocol interface.
  1392.  
  1393.    01001 TX Enable
  1394.  
  1395.    This command enables the  Ethernet controller  transmitter.  It  does
  1396.    not initiate transmission of a packet, which will not occur until  at
  1397.    least the TX Start threshold bytes  of  the  packet  (or  the  entire
  1398.    packet) are in the TX FIFO.  At power-up, the transmitter is disabled
  1399.    and must be enabled with this  command.  To disable, use TX  Disable.
  1400.    Transmit errors will also disable the transmitter.
  1401.  
  1402.    01010 TX Disable
  1403.  
  1404.    This command disables the  Ethernet  controller  transmitter.   If  a
  1405.    packet is currently being transmitted (that is, it has been presented
  1406.    to the Ethernet controller), issuing  this command will not stop  the
  1407.    transmission.  The transmitter will be disabled after the packet  has
  1408.    been completely transmitted (or has reached a nonrecoverable  error).
  1409.    The transmitter is disabled on power-up, and can also become disabled
  1410.    as a result of a transmit error.
  1411.  
  1412.    01011 TX Reset (000 0000 0000)
  1413.  
  1414.    This  command  empties  the  TX  FIFO.   It  disables  the   Ethernet
  1415.    controller transmitter.  It also resets the TX Available and TX Start
  1416.    thresholds to defaults.  If a packet is currently being  transmitted,
  1417.    the transmit will be aborted and  a bad CRC generated on the  packet.
  1418.    After an underrun or jabber error on transmit, a TX Reset command  is
  1419.    required the transmitter is reenabled.  Do not issue TX Reset  unless
  1420.    it is absolutely required.  The argument to this command must be  all
  1421.    zeros.
  1422.  
  1423.    01100 Request Interrupt
  1424.  
  1425.    This command sets the Interrupt Requested bit in the Status register,
  1426.    causing an interrupt whenever that interrupt bit is unmasked.
  1427.  
  1428.    01101 Acknowledge Interrupt (000 xxxx xxxx)
  1429.  
  1430.    This command acknowledges the  interrupt  reasons  specified  in  the
  1431.    argument.  These bits are laid out identically to those in the Status
  1432.    register.  If a bit  is set, it  acknowledges that interrupt  reason,
  1433.    and will in some cases turn off  the bit in the Status register.   In
  1434.    other cases, the bit in the  Status register is wired to the  adapter
  1435.    state, and that state must be changed  in order to turn the bit  off.
  1436.    In this case, setting  the bit in  the Acknowledge Interrupt  command
  1437.    has no effect.  If a  bit is set in the  command and that bit is  not
  1438.    set in the Status register,  nothing  happens.   For  each  bit,  the
  1439.    following specifies whether  or not acknowledging  it will force  the
  1440.    Status bit off.
  1441.  
  1442.         0000 0001 Interrupt Latch
  1443.  
  1444.         This command turns  off the Status  register bit, releasing  the
  1445.         interrupt.   This  bit  must  be  acknowledged  after  all   the
  1446.         interrupt reasons have been processed  or masked off.  This  bit
  1447.         must be acknowledged before  the End-of-Interrupt (EOI)  command
  1448.         is issued to the Programmable Interrupt Controller (8259 PIC).
  1449.  
  1450.  
  1451.  
  1452.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-3
  1453.  
  1454.         0000 0010 Adapter Failure
  1455.  
  1456.         This  command  does  nothing.   The  reason  bit  in  the   FIFO
  1457.         Diagnostic register (Bit 13  or  Bit  10)  must  be  cleared  to
  1458.         recover from this state.
  1459.  
  1460.         0000 0100 TX Complete
  1461.  
  1462.         This command does nothing.   The host must  write the TX  Status
  1463.         register (popping it) to turn the bit off (assuming there are no
  1464.         other transmit completions pending).
  1465.  
  1466.         0000 1000 TX Available
  1467.  
  1468.         This command turns off the Status register bit and resets the TX
  1469.         Available threshold to its disabled value.  The Set TX Available
  1470.         Threshold command must be reissued each time it is required.
  1471.  
  1472.         0001 0000 RX Complete
  1473.  
  1474.         This command does nothing.  To turn off the Status register bit,
  1475.         the host must  read the remainder  of the packet  out of the  RX
  1476.         FIFO (unless there is another complete packet in the RX FIFO)
  1477.  
  1478.         0010 0000 RX Early
  1479.  
  1480.         This command turns off the  Status register bit.  RX Early  will
  1481.         remain off for the duration of  this packet unless the RX  Early
  1482.         threshold is  reprogrammed.  To  change the  RX Early  threshold
  1483.         without having this bit turn  on again, reprogram the  threshold
  1484.         before acknowledging the RX  Early bit.   See the  Set RX  Early
  1485.         Threshold command for more details.
  1486.  
  1487.         0100 0000 Interrupt Requested
  1488.  
  1489.         This command turns off the Status register bit.
  1490.  
  1491.         1000 0000 Update Statistics
  1492.  
  1493.         This command does nothing.  To turn off the Status register bit,
  1494.         read the statistics.  This will reset them all to zero.
  1495.  
  1496.    01110 Set Interrupt Mask (000 xxxx xxxz)
  1497.  
  1498.    This command sets the Interrupt  mask; each bit  that is set  enables
  1499.    interrupts from that  interrupt source.  To  mask off all  interrupts
  1500.    from the adapter, set the Interrupt mask to zero.  When an  interrupt
  1501.    reason is masked off, the  corresponding interrupt bit in the  Status
  1502.    register is still readable, although  it is  no longer  a source  for
  1503.    interrupts.  Use the Set Read Zero mask command to force the bits  to
  1504.    read as zero.  The bits are  laid out identically to their  locations
  1505.    in the Status register.  At power-up, the Interrupt mask defaults  to
  1506.    zero.
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-4
  1519.  
  1520.    01111 Set Read Zero Mask (000 xxxx xxxz)
  1521.  
  1522.    This command sets the Read Zero  mask; each bit that is clear  causes
  1523.    the corresponding bit in the  Status register to  read as zero.   The
  1524.    Read Zero mask is applied to the Status register before the Interrupt
  1525.    mask.  Clearing a  bit in the  Read Zero mask  also prevents it  from
  1526.    causing interrupts.  To force all interrupt sources to zero, set  the
  1527.    Read Zero mask to zero.   Use  the  Set  Interrupt  mask  command  to
  1528.    disable interrupts and still allow the bit in the Status register  to
  1529.    be readable.  The bits are laid out identically to their locations in
  1530.    the Status register.  At  power-up, the  Read Zero  mask defaults  to
  1531.    zero.
  1532.  
  1533.    NOTE: The Interrupt  Latch bit  cannot be  forced to  zero with  this
  1534.    command.
  1535.  
  1536.    10000 Set RX Filter (000 0000 xxxx)
  1537.  
  1538.    This command sets the Receive filter as follows:
  1539.  
  1540.         0001    Individual address
  1541.         0010    Group (multicast) addresses
  1542.         0100    Broadcast address
  1543.         1000    All addresses (promiscuous mode)
  1544.  
  1545.    At power-up, the Receive filter  defaults to  zero, and  must be  set
  1546.    with this command before any packets can be received.  Enabling group
  1547.    address reception implies broadcast reception.
  1548.  
  1549.    10001 Set RX Early Threshold (xxx xxxx xxzz)
  1550.  
  1551.    This command  sets  the  RX  Early  threshold.   Once  the  RX  Early
  1552.    threshold bytes of a packet have been received, an RX Early interrupt
  1553.    will be generated to the host.  A multiple of four with a range of  0
  1554.    to 2032 bytes is  used.   To  disable,  set  to  2032  (the  power-on
  1555.    default).  Truncated to a dword  multiple.  Normal collisions may  be
  1556.    received as bad packets by the host if the RX Early threshold is  set
  1557.    to less than 60 bytes (one  slot time).  The driver must be  prepared
  1558.    to increase this value if  too many  bad packets  result because  the
  1559.    setting is less than 60 bytes.
  1560.  
  1561.    It must be  possible  to  reprogram  this  value  in  the  middle  of
  1562.    receiving a packet and still have  it go off when appropriate.   This
  1563.    feature might be used  by the software to  try and take an  interrupt
  1564.    just before its computed packet length, to overlap some of the packet
  1565.    reception with the expected  interrupt latency.  To  do this, and  to
  1566.    generate  another  interrupt,  the   RX  Early   threshold  must   be
  1567.    reprogrammed after the RX Early interrupt has been acknowledged.
  1568.  
  1569.    NOTES:
  1570.  
  1571.         1.  The RX Complete bit  masks the  RX Early  bit.  Whenever  RX
  1572.         Complete is set,  RX  Early  will  be  clear.   Also,  when  the
  1573.         Ethernet controller signals the end of a receive packet, thereby
  1574.         clearing the RX Incomplete bit  on the bottom  of the RX  Status
  1575.         stack, RX Early will be automatically acknowledged/cleared.
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-5
  1585.  
  1586.         2.  The current design  hides 16 bytes  of an incomplete  packet
  1587.         from the host.  Thus if RX Early is set to 24, 40 bytes must  be
  1588.         received before the packet becomes visible to the host.  At that
  1589.         point RX Status  shows  24  bytes  received.   When  the  packet
  1590.         reception is complete, the 16  bytes will be  added to the  byte
  1591.         count in the RX  Status register  all at  once.  Therefore,  the
  1592.         software does not need to be aware of this process.
  1593.  
  1594.         Future revisions of  the ASIC  will not  hide bytes;  it is  not
  1595.         advisable to set  RX Early  to values  less than  eight.  It  is
  1596.         suggested that software derive a variable and set it to 16 based
  1597.         on the ASIC revision level of 1 (refer to "Diagnostic Registers"
  1598.         later in this chapter).
  1599.  
  1600.    10010 Set TX Available Threshold (xxx xxxx xxzz)
  1601.  
  1602.    This command sets  the TX  Available threshold,  which specifies  the
  1603.    number of free bytes required by the host.  A TX Available  interrupt
  1604.    will be generated when the number  of  free  bytes  in  the  TX  FIFO
  1605.    exceeds this threshold.  This allows the host to return and wait  for
  1606.    sufficient free space before continuing to copy data to the TX FIFO.
  1607.  
  1608.    A multiple of four with a range of 0 to 2044 bytes is used.   Setting
  1609.    this threshold to 2044 (the power-on default) disables it.
  1610.  
  1611.    Once the TX Available bit  is acknowledged, the threshold returns  to
  1612.    2044, and it will not go off again.  Therefore, the Set TX  Available
  1613.    threshold command must be  reissued each time  the driver decides  to
  1614.    return control until sufficient space is available to continue.
  1615.  
  1616.    10011 Set TX Start Threshold (xxx xxxx xxzz)
  1617.  
  1618.    This command specifies  the  number  of  bytes  required  before  the
  1619.    adapter may start  transmitting the  packet.  The  packet will  start
  1620.    transmitting either when the number of  bytes in the TX FIFO  exceeds
  1621.    the TX Start threshold or when  the entire packet has been copied  to
  1622.    the TX FIFO.  A multiple of four with  a range of 0 to 2040 bytes  is
  1623.    used.  Setting this threshold to 2040 (the power-on default) disables
  1624.    it, so that packet  transmission starts only  when the entire  packet
  1625.    has been moved to the TX FIFO.
  1626.  
  1627.    This threshold can be used in combination with TX Available to  avoid
  1628.    transmit underruns.  Reset the  TX Start threshold  to more than  the
  1629.    number of bytes of a packet that were copied to the TX FIFO before it
  1630.    ran out of space.  This guarantees that no underrun will occur before
  1631.    the TX Available interrupt comes  in.  However, the transmit  packets
  1632.    may not go out with the minimum interpacket gap.
  1633.  
  1634.    10101 Statistics Enable
  1635.  
  1636.    This command enables  the collection  of statistics  by the  adapter.
  1637.    These statistics are maintained in Window 6 registers.  At  power-up,
  1638.    statistics collection is disabled  and  must  be  enabled  with  this
  1639.    command.  Before  any  of  the  statistics  in  Window  6  are  read,
  1640.    statistics  collection  must   be  temporarily   disabled  with   the
  1641.    Statistics Disable command.  Once  the  statistics  have  been  read,
  1642.    statistics can be reenabled with this command.
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-6
  1651.  
  1652.    10110 Statistics Disable
  1653.  
  1654.    This command disables  the collection of  statistics by the  adapter.
  1655.    At power-up, statistics collection is disabled.  The adapter  latches
  1656.    statistics update  requests while  the statistics  are disabled.   As
  1657.    long as statistics are only kept disabled long enough to read in  the
  1658.    statistics, no  statistics will  be lost  in the  process.  Refer  to
  1659.    "Statistics Registers" later in this chapter for more information.
  1660.  
  1661.    10111 Stop Coaxial Transceiver
  1662.  
  1663.    This command shuts off the  DC-DC converter that drives the  on-board
  1664.    coaxial transceiver.  This  command might be  used for diagnostic  or
  1665.    power-management reasons.  The host must delay at least 800 us  after
  1666.    issuing this command before  using the  AUI interface.   This can  be
  1667.    accomplished by starting the timer and  waiting until it pegs at  its
  1668.    maximum value of FFh.
  1669.  
  1670.  
  1671.    6.2 Status Register
  1672.  
  1673.    Function:    Reports the adapter state, including window number and
  1674.                 the reasons for the interrupt.
  1675.    Location:    All windows/Port 0E
  1676.    Type:        Read only
  1677.    Size:        16 bits (8-bit reads also allowed to either byte)
  1678.    Bit Description:
  1679.  
  1680.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  1681.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  1682.        |   Window  |CIP|    Reserved   | US| IR|RXE|RXC|TXA|TXC| AF| IL|
  1683.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  1684.  
  1685.         Bits 15-13      Window Number (0-7)
  1686.         Bit 12          Command-in-Progress
  1687.         Bit 11          Reserved
  1688.         Bit 10          Reserved
  1689.         Bit 9           Reserved
  1690.         Bit 8           Reserved
  1691.         Bit 7           Update Statistics*
  1692.         Bit 6           Interrupt Requested*
  1693.         Bit 5           RX Early*
  1694.         Bit 4           RX Complete*
  1695.         Bit 3           TX Available*
  1696.         Bit 2           TX Complete*
  1697.         Bit 1           Adapter Failure*
  1698.         Bit 0           Interrupt Latch
  1699.  
  1700.    Those bits marked with an asterick  (*) cause an interrupt when  set,
  1701.    assuming they are not masked off in either the Interrupt mask or  the
  1702.    Read Zero mask.  These bits can be forced to zero with the Read  Zero
  1703.    mask, disabled as a source of interrupts with the Interrupt mask,  or
  1704.    acknowledged with the Acknowledge  Interrupt command.   All of  these
  1705.    have identical layouts for these bits.
  1706.  
  1707.    NOTE: The low byte contains all of these interrupt causes and can  be
  1708.    used directly as an index into a dispatch table if desired.
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-7
  1717.  
  1718.    Bit 0 Interrupt Latch
  1719.  
  1720.    This bit is latched when the adapter raises an interrupt to the host.
  1721.    The bit is cleared when  it is acknowledged.   In a shared  interrupt
  1722.    environment (not ISA), this bit can  be used to determine the  source
  1723.    of the interrupt.
  1724.  
  1725.    NOTE: This bit does not cause an interrupt, it is the interrupt.
  1726.  
  1727.    Bit 1 Adapter Failure*
  1728.  
  1729.    An error occurred that  the  adapter  was  unable  to  recover  from.
  1730.    Possible causes are:
  1731.  
  1732.       - Transmit overrun (host writes more data than there is room for)
  1733.  
  1734.       - Receive underrun (host reads data that is not yet available)
  1735.  
  1736.       - Internally detected hardware errors as yet undefined
  1737.  
  1738.    Various diagnostic registers are available to determine the cause  of
  1739.    the failure.  The host  must issue the  appropriate Reset command  to
  1740.    clear this condition and recover.
  1741.  
  1742.    Bit 2 TX Complete*
  1743.  
  1744.    The adapter has finished transmitting a packet and has updated the TX
  1745.    Status register with its  transmit status (with  the TX Complete  bit
  1746.    set).  To clear this bit, the  host writes the TX Status register  to
  1747.    pop the transmit status off the TX Status stack.
  1748.  
  1749.    NOTE: A TX Complete interrupt  is  signaled  only  for  packets  that
  1750.    failed to transmit successfully or  packets with a transmit  preamble
  1751.    bit set specifically for an interrupt on successful transmission.
  1752.  
  1753.    If TX Status indicates a transmit underrun or jabber error, then a TX
  1754.    Reset command will be necessary.  In  any event, a TX Enable  command
  1755.    will be required to restart  the transmitter after any error.   Refer
  1756.    to "TX Status" later in this chapter for more information.
  1757.  
  1758.    Bit 3 TX Available*
  1759.  
  1760.    The number of free bytes in the TX FIFO now exceeds the TX  Available
  1761.    threshold.
  1762.  
  1763.    Bit 4 RX Complete*
  1764.  
  1765.    A complete packet is available  in the RX FIFO.   This bit is set  if
  1766.    the Incomplete bit in the RX Status register is zero.  To clear  this
  1767.    bit, the host must  read the packet  out of the  RX FIFO.  A  receive
  1768.    overrun requires no special action  on the  part of  the host,  other
  1769.    than discarding the packet.
  1770.  
  1771.    Bit 5 RX Early*
  1772.  
  1773.    Sufficient bytes of the current  packet have been received to  exceed
  1774.    the RX Early threshold, although the packet is not yet complete.  See
  1775.    the Set RX Early Threshold command for more details.
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-8
  1783.  
  1784.    Bit 6 Interrupt Requested*
  1785.  
  1786.    This bit is set by the Request Interrupt command.  To clear this bit,
  1787.    simply acknowledge it.  It provides a  way for the driver to  request
  1788.    an interrupt for its own purposes.
  1789.  
  1790.    Bit 7 Update Statistics*
  1791.  
  1792.    This bit indicates that one  or more  of the  statistics counters  is
  1793.    nearing an overrun condition (typically half its maximum value).  The
  1794.    host must read out  all  of  the  statistics  and  update  its  local
  1795.    counters from them (zeroing  the  counters  on  the  adapter  in  the
  1796.    process and thereby clearing this bit).
  1797.  
  1798.    Bit 12 Command-in-Progress
  1799.  
  1800.    This bit is  set to indicate  that the last  command issued is  still
  1801.    being processed by the adapter.  It need be checked only after one of
  1802.    the commands has been issued that may require more than a single  I/O
  1803.    cycle for completion (that is, those  marked with an asterick [*]  in
  1804.    the command).  No other commands  may be  issued until  this bit  has
  1805.    been reset.  This check must be done with interrupts disabled.
  1806.  
  1807.    Bits 15-13 Window Number
  1808.  
  1809.    This bit reflects the current window set and must be visible in every
  1810.    window.
  1811.  
  1812.  
  1813.    6.3 FIFO Registers
  1814.  
  1815.    6.3.1 RX Status
  1816.  
  1817.    Function:    Contains the status and number of bytes for the receive
  1818.                 packet at the top ofthe RX FIFO.
  1819.    Location:    Window 1/Port 08
  1820.    Type:        Read only
  1821.    Size:        16 bits
  1822.    Bit Description:
  1823.  
  1824.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  1825.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  1826.        | I | E | Error Type|                RxBytes                    |
  1827.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  1828.  
  1829.         Bit 15          Incomplete (1 = RX packet is incomplete or RX
  1830.                         FIFO empty)
  1831.         Bit 14          Error (1 = Error in RX packet, 0 if incomplete
  1832.                         or no error)
  1833.         Bits 13-11      Type of error (Undefined if no error, highest
  1834.                         priority first)
  1835.                 1000 =  Overrun
  1836.                 1011 =  Runt Packet Error
  1837.                 1100 =  Alignment (Framing) Error
  1838.                 1101 =  CRC Error
  1839.                 1001 =  Oversize Packet Error (>1514 bytes)
  1840.                 0010 =  Dribble Bit(s)
  1841.                 0000 and all other codes =  No Errors
  1842.         Bits 10-1       RX Bytes (0-1514)
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.            3Com 3C509 and 3C509-TP Technical Reference Guide         6-9
  1849.  
  1850.    This register is  a ripple-through  FIFO that  advances one  position
  1851.    (popping the stack) after issuing an RX Discard command.  As a packet
  1852.    is received off the wire, its corresponding RX Status entry  (visible
  1853.    if this is the  only  packet  in  the  RX  FIFO)  has  its  RX  Bytes
  1854.    incremented.  Until the end of the  packet is received and placed  in
  1855.    the RX FIFO,  the Incomplete bit  will remain set  and the Error  bit
  1856.    will be clear.  Once the packet has been completely moved into the RX
  1857.    FIFO, the Incomplete bit  will be cleared and  the Error bit and  the
  1858.    error type will be set appropriately.
  1859.  
  1860.    The  error  bits  encode  the  packet  status.   If  multiple  errors
  1861.    occurred, the highest priority error  will be shown.  For example,  a
  1862.    runt with a CRC error will  be flagged  as a  runt.  If  a packet  is
  1863.    flagged as overrun,  the host must  not rely on  the contents of  the
  1864.    packet (it may have holes in it where the data was lost).
  1865.  
  1866.    A packet with only a Dribble Bit error is a valid packet and must  be
  1867.    read by the driver software.   The  Dribble  Bit  indication  is  for
  1868.    informational purposes only.
  1869.  
  1870.    An oversized  packet (longer  than 1514  bytes) will  continue to  be
  1871.    received correctly until it reaches 1792  bytes, when it will be  cut
  1872.    off and the remainder discarded.
  1873.  
  1874.    If the packet is not read from  the RX FIFO until the Incomplete  bit
  1875.    is cleared, then  the RX  Bytes field  will show  the packet  length,
  1876.    assuming there were no errors.
  1877.  
  1878.    As the packet is read from the RX FIFO, RX Bytes will be decremented.
  1879.    This can be done before  the packet  is completely  received; the  RX
  1880.    Bytes will never show the actual packet size.
  1881.  
  1882.    RX Bytes reflects the number  of  bytes  of  packet  data  that  were
  1883.    received, and does not include any padding to a dword multiple.   The
  1884.    current implementation hides 16 received bytes from the host, so that
  1885.    the RX Bytes count will  always be 16 less  than the number of  bytes
  1886.    received off the wire until the packet is completed.  At that  point,
  1887.    RX Bytes will be incremented by 16 bytes.
  1888.  
  1889.    A packet becomes visible to the  host  through  RX  Status  once  the
  1890.    number of  bytes received  (minus the  hidden 16  bytes) exceeds  the
  1891.    minimum of 60 and the RX Early threshold.  At that point, the  number
  1892.    of bytes received (minus 16)  becomes visible  in RX  Bytes and  will
  1893.    continue to increment as more bytes are received.  If an error in the
  1894.    packet is signaled before the packet becomes visible to the host, the
  1895.    packet is discarded.  Otherwise, the  packet will show  up in the  RX
  1896.    Status stack flagged with an error.
  1897.  
  1898.    When reading the last byte of  the actual packet data, RX Bytes  will
  1899.    show 1.  If the packet  was not a multiple  of four in length,  there
  1900.    may be more bytes to read because of padding.  After reading the last
  1901.    byte, RX Bytes  will change to  0.  After reading  one more byte,  it
  1902.    will change to -1 (11111111111), then -2 (11111111110) after one more
  1903.    byte, then -3, and so on.  RX Bytes can go as far as -5.
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-10
  1915.  
  1916.    6.3.2 TX Status
  1917.  
  1918.    Function:    Reports the transmit status of a completed transmission.
  1919.                 Reading this register pops the transmit completion
  1920.                 stack.
  1921.    Location:    Window 1/Port 0B
  1922.    Type:        Read only
  1923.    Size:        8 bits
  1924.    Bit Description:
  1925.  
  1926.          7   6   5   4   3   2   1   0
  1927.        +---+---+---+---+---+---+---+---+
  1928.        | C | I | J | U | MC|TSO| Undef |
  1929.        +---+---+---+---+---+---+---+---+
  1930.  
  1931.         Bit 7           Complete (1 = TX is Complete)
  1932.         Bit 6           Interrupt on Successful Transmission Requested
  1933.         Bit 5           Jabber Error (TP only, TX Reset required)
  1934.         Bit 4           Underrun (TX Reset required)
  1935.         Bit 3           Maximum Collisions
  1936.         Bit 2           TX Status Overflow
  1937.         Bits 1-0        Undefined
  1938.  
  1939.    The hardware uses the TX  Status register to stack information  about
  1940.    transmit completions that must be signaled to the driver.  Whenever a
  1941.    transmit is completed that must  be signaled to  the host (either  it
  1942.    failed,  or  the  preamble  specified  an  interrupt  on   successful
  1943.    transmission), the adapter pushes  the  status  onto  the  TX  Status
  1944.    stack.  When the host fields the  TX Complete interrupt, it can  read
  1945.    TX Status to determine the transmit status.  The TX Complete bit will
  1946.    not be set  if  the  stack  is  currently  empty  (nothing  to  pop).
  1947.    Whenever the driver writes the TX Status register and the TX Complete
  1948.    bit is set, this pops the  stack,  and  the  next  transmit  complete
  1949.    status can be read (if  any).  Popping everything  off the TX  Status
  1950.    stack turns off the TX Complete interrupt in the Status register.  Do
  1951.    not write to the TX Status  register unless you have read a  non-zero
  1952.    value at this location.  To do so may clear a yet-to-be seen transmit
  1953.    status.
  1954.  
  1955.    If an error is indicated, then the transmitter has been disabled  and
  1956.    must be reenabled  with the TX  Enable command.  If  the error was  a
  1957.    maximum collisions error, then nothing  more  is  required.   If  the
  1958.    error was a jabber or an  underrun, however, then a TX Reset  command
  1959.    is required before the TX Enable can be issued.
  1960.  
  1961.    When the completion of a packet  is signaled to the host, the  packet
  1962.    has been discarded from the TX  FIFO.  If it is to be  retransmitted,
  1963.    it must again be copied to the TX FIFO.  If the error occurred  while
  1964.    the packet was still being  copied  to  the  adapter,  the  host  can
  1965.    continue to copy the packet to the adapter, since the transmitter  is
  1966.    disabled.
  1967.  
  1968.    NOTE: Free Transmit Bytes may take an additional I/O cycle to  update
  1969.    after the packet transmission has been completed.
  1970.  
  1971.    The Interrupt on Successful  Transmission Requested bit reflects  the
  1972.    same bit in the  TX preamble for this  packet.  The protocol can  use
  1973.    this bit to determine whether this is the packet on the head of  some
  1974.    "to be completed" queue, or  simply a packet  that it has  forgotten.
  1975.    In either case the host  can  use  this  opportunity  to  update  any
  1976.    statistics counters it may have.
  1977.  
  1978.  
  1979.  
  1980.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-11
  1981.  
  1982.    The TX Status  Overflow bit,  if set,  indicates that  the TX  Status
  1983.    stack is full, and as  a result  the transmitter  has been  disabled.
  1984.    Simply reading the TX Status  register clears this condition, so  the
  1985.    only other action required is  a TX  Enable command.   The TX  Status
  1986.    stack can hold exactly 31 entries,  so this condition is unlikely  in
  1987.    normal operation.  No packets are dropped or confirmations lost  when
  1988.    this condition is entered.
  1989.  
  1990.    6.3.3 RX PIO Data Read
  1991.  
  1992.    Function:    Used to read data from the RX FIFO.
  1993.    Location:    Window 1/Port 00 and Port 02
  1994.    Type:        Read only
  1995.    Size:        16 bits/8 bits allowed from lower byte
  1996.    Bit Description:
  1997.  
  1998.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  1999.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2000.        |                        RX PIO Data Read                       |
  2001.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2002.  
  2003.         Bits 15-0       RX PIO Data Read
  2004.  
  2005.    This register is used  to read data  from the RX  FIFO.  A word  read
  2006.    will pop a  word off the  head of the  RX FIFO.  A  byte read to  the
  2007.    low-order byte of the register will pop a byte off the RX FIFO.  Byte
  2008.    reads to the high-order byte are not allowed.  Double word reads  are
  2009.    also possible when this register is used in combination with the  one
  2010.    after it (which is treated identically by the hardware).  Such  reads
  2011.    pop two successive words off the RX FIFO, returning the first in  the
  2012.    low-order word, and the second in the high-order word.
  2013.  
  2014.    Although byte and word reads are  allowed, the packet data is  always
  2015.    padded to a dword  boundary.  The RX Discard  command can be used  to
  2016.    skip this padding.
  2017.  
  2018.    6.3.4 TX PIO Data Write
  2019.  
  2020.    Function:    Used to write data to the TX FIFO.
  2021.    Location:    Window 1/Port 00 and Port 02
  2022.    Type:        Write only
  2023.    Size:        16 bits/8 bits allowed to lower byte
  2024.    Bit Description:
  2025.  
  2026.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2027.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2028.        |                      TX PIO Data Write                        |
  2029.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2030.  
  2031.         Bits 15-0       TX PIO Data Write
  2032.  
  2033.    This register is used  to write data  to the TX  FIFO.  A word  write
  2034.    will push a word onto the tail of  the TX FIFO.  A byte write to  the
  2035.    low-order byte of  the register will  push a byte  onto the TX  FIFO.
  2036.    Byte writes  to the  high-order byte  are not  allowed.  Double  word
  2037.    writes are also possible  when this register  is used in  combination
  2038.    with the one after it (which is treated identically by the hardware).
  2039.    Such writes push two successive words  on the TX FIFO; the  low-order
  2040.    word first, then the high-order word.
  2041.  
  2042.    Although byte and word writes  are  allowed,  the  packet  data  must
  2043.    always be padded to a dword boundary.
  2044.  
  2045.  
  2046.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-12
  2047.  
  2048.    6.3.5 Free Receive Bytes
  2049.  
  2050.    Function:    Returns the number of bytes available in the RX FIFO.
  2051.    Location:    Window 3/Port 0A
  2052.    Type:        Read only
  2053.    Size:        16 bits
  2054.    Bit Description:
  2055.  
  2056.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2057.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2058.        | 0 | 0 | 0 | 0 | 0 |          Free Receive Bytes       | 0 | 0 |
  2059.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2060.  
  2061.         Bits 10-2       Free Receive Bytes (0-2044)
  2062.  
  2063.    Free Receive Bytes equal to 0 imply that the RX FIFO is full.
  2064.  
  2065.    6.3.6 Free Transmit Bytes
  2066.  
  2067.    Function:    Returns the number of bytes available in the TX FIFO.
  2068.    Location:    Window 1/Port 0C and Window 3/Port 0C
  2069.    Type:        Read only
  2070.    Size:        16 bits
  2071.    Bit Description:
  2072.  
  2073.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2074.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2075.        | 0 | 0 | 0 | 0 | 0 |         Free Transmit Bytes       | 0 | 0 |
  2076.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2077.  
  2078.         Bits 10-2       Free Transmit Bytes (0-2044)
  2079.  
  2080.    Free Transmit Bytes equal to 0 imply that the TX FIFO is full.   When
  2081.    Free Transmit Bytes are not zero, that number of bytes can be written
  2082.    to the TX FIFO without an overrun.
  2083.  
  2084.  
  2085.    6.4 Timer Register
  2086.  
  2087.    Function:    Interrupt latency measurement
  2088.    Location:    Window 1/Port 0A
  2089.    Type:        Read only
  2090.    Size:        8 bits
  2091.    Bit Description:
  2092.  
  2093.          7   6   5   4   3   2   1   0
  2094.        +---+---+---+---+---+---+---+---+
  2095.        |             Timer             |
  2096.        +---+---+---+---+---+---+---+---+
  2097.  
  2098.         Bits 7-0        Timer
  2099.  
  2100.    The Timer register is  a free-running 8-bit  counter that is  running
  2101.    off a 10 MHz/32  clock (period  = 3.2  us, the  quadbyte rate).   The
  2102.    count is reset to zero whenever the interrupt output transitions from
  2103.    inactive to active.  This allows the driver to make interrupt latency
  2104.    measurements and  evaluate other  system-dependent parameters.   When
  2105.    the Timer bit reaches 255, it stops incrementing.
  2106.  
  2107.    To  use  this  counter  for  more  general  measurements  at   driver
  2108.    initialization time, disable interrupts and issue a Request Interrupt
  2109.    command to reset the counter.
  2110.  
  2111.  
  2112.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-13
  2113.  
  2114.    6.5 Statistics Registers
  2115.  
  2116.    The statistics registers in Window 6 make available various  counters
  2117.    maintained by the  adapter.  Before reading  any of these  registers,
  2118.    the host must disable statistics collection by issuing the Statistics
  2119.    Disable command.  Reading any statistic resets it to zero.   Counters
  2120.    that are 16 bits  in the interface must  be read as words.   Counters
  2121.    that are 8 bits must be read as bytes.  After the counters have  been
  2122.    read,  the  Statistics  Enable  command  must  be  used  to  reenable
  2123.    statistics collection.
  2124.  
  2125.    The size of the  internal counters  on the  adapter varies.   Several
  2126.    counters are 6 bits, and several are only 4 bits.  Counters less than
  2127.    8 bits long get zero fill to 8 bits across the interface.  An  Update
  2128.    Statistics interrupt is generated when any statistic reaches half its
  2129.    maximum value (that is, its upper bit gets set).  The exceptions  are
  2130.    the two 16-bit counters that generate an Update Statistics  interrupt
  2131.    only when the upper 3  bits are set  (so they can  use more of  their
  2132.    range before they require reading).
  2133.  
  2134.    The proper method  for  servicing  this  interrupt  is  to  read  all
  2135.    statistics and to  accumulate proper  32-bit values  in host  memory.
  2136.    This will reset each statistic in turn and update all statistics in a
  2137.    relatively coherent manner.   There is no  bit available to  indicate
  2138.    which counter reached half its value.  Once all of the counters  have
  2139.    been read, the Update Statistics bit  in the Status register will  be
  2140.    cleared.  The adapter latches  statistics update  requests while  the
  2141.    statistics are disabled.   As long  as statistics  are kept  disabled
  2142.    only long enough to read  the statistics  in, no  statistics will  be
  2143.    lost in the process.
  2144.  
  2145.    Writing to the statistics registers is supported to allow for  simple
  2146.    debugging.  When a value is  written to the statistics registers,  it
  2147.    is added to the statistics current value.  This is done using much of
  2148.    the  normal  statistics   collection   state   machine.    Statistics
  2149.    collection must be enabled for the addition to take place.
  2150.  
  2151.    The following network statistics  are defined primarily according  to
  2152.    the NDIS specification, version 2.01.
  2153.  
  2154.    6.5.1 Statistics
  2155.  
  2156.    Function:    Read and zero internal counters
  2157.    Location:    Window 6/Ports 00 thru 0C
  2158.    Type:        Read/write (reading resets counter)
  2159.    Size:        8 bits/16 bits (16 bits as words, all else as bytes)
  2160.    Bit Description:
  2161.  
  2162.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2163.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2164.        |                        Counter Value                          |
  2165.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2166.  
  2167.      or
  2168.  
  2169.          7   6   5   4   3   2   1   0
  2170.        +---+---+---+---+---+---+---+---+
  2171.        |        Counter Value          |
  2172.        +---+---+---+---+---+---+---+---+
  2173.  
  2174.         Bits 15-0 or 7-0        Counter Value
  2175.  
  2176.  
  2177.  
  2178.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-14
  2179.  
  2180.    These counters collect  statistics of transmit  or receive events  as
  2181.    long  as  statistics  are  currently  enabled.   Statistics  must  be
  2182.    disabled before they can  be read.  Reading  a statistic also  zeroes
  2183.    it.  To check proper  function of  the statistics  logic, values  can
  2184.    also be written to the  statistics.  Writing  a value  will add  that
  2185.    value to the current  statistic as long  as statistics are  currently
  2186.    enabled.  The 16-bit statistics must  be read/written as a word;  all
  2187.    others must be read/written as bytes.
  2188.  
  2189.    FIFO loopback can  cause the various  statistics registers to  return
  2190.    indeterminate  values.    After   leaving   FIFO   loopback,   enable
  2191.    statistics, then disable and read all the statistics to clear them.
  2192.  
  2193.  
  2194.    Port Offset  Size (bits)     Description of Statistic
  2195.    -----------  -----------     ------------------------
  2196.        0C           16          Total bytes transmitted successfully
  2197.                                 with no errors noted.
  2198.        0A           16          Total bytes received successfully.  This
  2199.                                 number excludes runts, overruns, and
  2200.                                 frames discarded before completion.
  2201.        08            8          Total transmit deferrals.
  2202.        07            8          Total frames received successfully.
  2203.                                 This number excludes runts, overruns,
  2204.                                 and frames discarded before completion.
  2205.        06            8          Total frames transmitted successfully
  2206.                                 with no errors noted.
  2207.        05            8          Total receive frames discarded because
  2208.                                 of RX FIFO overrun.  This includes only
  2209.                                 those packets seen by the host as RX
  2210.                                 overruns.  It does not include those
  2211.                                 discarded without a trace because the
  2212.                                 RX FIFO was completely full.
  2213.        04            8          Late collisions on transmit.
  2214.        03            6          Total frames transmitted after one
  2215.                                 collision.
  2216.        02            6          Total frames transmitted after multiple
  2217.                                 collisions.
  2218.        01            4          Total frames transmitted with no CD
  2219.                                 heartbeat (SQE).  This statistic is only
  2220.                                 collected if the SQE Statistic Enable
  2221.                                 bit (bit 3 of the Media Type and Status
  2222.                                 register) is set.  Since certain
  2223.                                 external transceivers do not support
  2224.                                 SQE, this statistic can be disabled to
  2225.                                 avoid excessive update statistics.
  2226.        00            4          Total carrier sense lost during
  2227.                                 transmission.
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-15
  2245.  
  2246.    6.6 Diagnostic Registers
  2247.  
  2248.    6.6.1 Media Type and Status
  2249.  
  2250.    Function:    Reports media type/configuration and status.
  2251.    Location:    Window 4/Port 0A
  2252.    Type:        Read/write (only certain bits are writable)
  2253.    Size:        16 bits
  2254.    Bit Description:
  2255.  
  2256.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2257.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2258.        |AUI|BNC|IEN|SQE|LKC|POL|JAB|USQ|LKE|JBE|CRS|COL|SEN| 0 | 0 | 0 |
  2259.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2260.  
  2261.         Bit 15  1 = AUI disable (read only).
  2262.         Bit 14  1 = BNC transceiver (read only).
  2263.         Bit 13  1 = Internal encoder/decoder (read only).
  2264.         Bit 12  1 = SQE present (read only).
  2265.         Bit 11  1 = Link beat correct (TP) (read only).
  2266.         Bit 10  1 = Polarity swap (TP) (read only).
  2267.         Bit 9   1 = Jabber (TP) (read only).
  2268.         Bit 8   1 = Unsquelch (TP) (read only).
  2269.         Bit 7   1 = Link beat enabled (writable). Defaults to 0
  2270.                     (disabled). Must be set by software only if the
  2271.                     internal TP transceiver is in use. Link Beat must
  2272.                     be disabled in ENDEC loopback mode.
  2273.         Bit 6   1 = Jabber enabled (writable).  Defaults to 0
  2274.                     (disabled). Must be set by software only if the
  2275.                     internal TP transceiver is in use. This also
  2276.                     enables the polarity reversal state machine.
  2277.         Bit 5   1 = Carrier sense (CRS) (read only).
  2278.         Bit 4   1 = Collision (read only).
  2279.         Bit 3   1 = SQE Statistics Enable. Defaults to 0 (disabled).
  2280.                     Must be enabled by software at startup, and disabled
  2281.                     only if the number of SQE errors becomes excessive
  2282.                     in AUI mode, which probably indicates that the
  2283.                     external transceiver does not support SQE.
  2284.         Bits 2-0    Unassigned, read as zero.
  2285.  
  2286.    6.6.2 Net Diagnostic Port
  2287.  
  2288.    Function:    Supports the network diagnostic.
  2289.    Location:    Window 4/Port 06
  2290.    Type:        Read/write (only certain bits are writable)
  2291.    Size:        16 bits
  2292.    Bit Description:
  2293.  
  2294.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2295.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2296.        |EXL|ENL|ECL|FFL|TXE|RXE|TXT|TXR|STE| U |   ASIC Revision   |TLV|
  2297.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2298.  
  2299.         Bit 15  1 = External  loopback (read/write).   Setting this  bit
  2300.                     enables   an   external   loopback   mode   allowing
  2301.                     simultaneous transmit and receive  (TP, BNC, or  AUI
  2302.                     external loopback mode).
  2303.         Bit 14  1 = ENDEC  loopback  (read/write).   Setting   this  bit
  2304.                     enables  a  loopback  mode  at  the  output  of  the
  2305.                     encoder/decoder.  You must disable link beat through
  2306.                     the Media Type and  Status register before  enabling
  2307.                     ENDEC loopback.
  2308.  
  2309.  
  2310.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-16
  2311.  
  2312.         Bit 13  1 = Ethernet Controller loopback (read/write).   Setting
  2313.                     this bit enables  loopback  at  the  output  of  the
  2314.                     Ethernet Controller transceiver.
  2315.         Bit 12  1 = FIFO loopback  (read/write).  This loopback  returns
  2316.                     data through the FIFO  at the interface between  the
  2317.                     Ethernet Controller  transmitter and  the FIFO.   In
  2318.                     FIFO loopback mode, overruns  and underruns are  not
  2319.                     possible  -  the data  is simply  moved between  the
  2320.                     FIFOs as it is available.
  2321.         Bit 11  1 = TX enabled (read only).  Can be cleared by TX Reset,
  2322.                     TX Disable, or as a result of a transmit error.
  2323.         Bit 10  1 = RX enabled (read only).
  2324.         Bit 9   1 = TX  transmitting  (read  only).   Set  if  you  are
  2325.                     transmitting or deferring before transmitting.
  2326.         Bit 8   1 = TX Reset required (read only).  Set  if a jabber  or
  2327.                     underrun error occurs, both  of which  require a  TX
  2328.                     Reset for recovery.
  2329.         Bit 7   1 = Statistics enabled (read only).
  2330.         Bit 6       Unassigned.
  2331.         Bits 5-1    ASIC revision level.  Currently 1.  Future revisions
  2332.                     of the  ASIC that  change the  functionality in  any
  2333.                     significant way will modify this value.
  2334.         Bit 0   1 = Test low  voltage detector.  Setting  this bit to  1
  2335.                     will reset the ASIC if the low- voltage detector  is
  2336.                     functional.   This   bit   defaults   to   zero   at
  2337.                     power-up/reset.  This  bit must  remain zero  except
  2338.                     for ASIC functional testing.
  2339.  
  2340.    6.6.3 FIFO Diagnostic Port
  2341.  
  2342.    Function:    Supports the FIFO diagnostics.
  2343.    Location:    Window 4/Port 04
  2344.    Type:        Read/write (only certain bits are writable)
  2345.    Size:        16 bits
  2346.    Bit Description:
  2347.  
  2348.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2349.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2350.        |RXR|RES|RXU|RSO|RXO|TXO|  RES  |      Built-in Self Test       |
  2351.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2352.  
  2353.         Bit 15  1 = RX receiving (read only). Set when a packet is being
  2354.                     received into the RX FIFO.
  2355.  
  2356.         Bit 14      Reserved.
  2357.  
  2358.         Bit 13  1 = RX Underrun (read only).  Generates Adapter  Failure
  2359.                     interrupt.   Requires  RX  Reset  or  Global   Reset
  2360.                     command to recover.  An  RX  Underrun  is  generated
  2361.                     only when you read  past  the  end  of  a  packet  -
  2362.                     reading past what has been received so far will give
  2363.                     bad data.
  2364.  
  2365.         Bit 12  1 = RX Status Overrun (read  only).  Set when there  are
  2366.                     already eight packets in  the RX  FIFO.  While  this
  2367.                     bit is set,  no  additional  packets  are  received.
  2368.                     Requires no action  on the  part of  the host.   The
  2369.                     condition is cleared once a packet has been read out
  2370.                     of the RX FIFO.
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-17
  2377.  
  2378.         Bit 11  1 = RX Overrun (read only). Set when the RX FIFO is full
  2379.                     (there may  not be  an overrun  packet yet).   While
  2380.                     this bit is  set,  no  additional  packets  will  be
  2381.                     received (some additional bytes can still be pending
  2382.                     between the wire and  the  RX  FIFO).   Requires  no
  2383.                     action on the  part of the  host.  The condition  is
  2384.                     cleared once a few bytes  have been read out of  the
  2385.                     RX FIFO.
  2386.  
  2387.         Bit 10  1 = TX Overrun (read  only).  Generates Adapter  Failure
  2388.                     interrupt.  Requires the  TX Reset  or Global  Reset
  2389.                     command to recover.  Disables transmitter.
  2390.  
  2391.         Bits 9-8    Unassigned.
  2392.  
  2393.         Bits 7-0    These  bits  are   used  to  execute  the   Built-in
  2394.                     Self-test (BIST) circuitry for  both the  RX and  TX
  2395.                     FIFOs.  These bits will give 100% fault coverage for
  2396.                     stuck-on faults, transition faults, coupling faults,
  2397.                     and addressing (decoder) faults.  They are  intended
  2398.                     primarily for  testing the  ASICs, but  can also  be
  2399.                     included in a diagnostic self-test.  The two  tests,
  2400.                     RX and TX, are run independently.  To perform either
  2401.                     test, first reset, then  set  the  appropriate  BIST
  2402.                     bit.   Loop  until  the   BC  is  set  (this   takes
  2403.                     approximately 500 ms).   If  BF  is  set,  the  test
  2404.                     failed.  Otherwise check for BF  stuck at 0.  To  do
  2405.                     this, set BFC, then reset  it.  BF must now be  set.
  2406.                     If not, BF is stuck.  If everything passes, then the
  2407.                     RAM is fully functional.  All read-only bits default
  2408.                     to reset (0) at power-up.
  2409.  
  2410.                         Bit 7   RX BIST (write only).
  2411.                         Bit 6   RX BFC (write only).
  2412.                         Bit 5   RX BF (read only).
  2413.                         Bit 4   RX BC (read only).
  2414.                         Bit 3   TX BIST (write only).
  2415.                         Bit 2   TX BFC (write only).
  2416.                         Bit 1   TX BF (read only).
  2417.                         Bit 0   TX BC (read only).
  2418.  
  2419.    6.6.4 Host Diagnostic Port
  2420.  
  2421.    Function:    Supports host interface diagnostic.
  2422.    Location:    Window 4/Port 02
  2423.    Type:        Read/Write (only certain bits are writable)
  2424.    Size:        16 bits
  2425.    Bit Description:
  2426.  
  2427.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2428.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2429.        |                            Reserved                           |
  2430.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2431.  
  2432.         Bits 15-0       Reserved.
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-18
  2443.  
  2444.    6.6.5 TX Diagnostic Port
  2445.  
  2446.    Function:    Supports Ethernet Controller transmit diagnostic.
  2447.    Location:    Window 4/Port 00
  2448.    Type:        Read/Write (only certain  bits  are  writable)  The  The
  2449.                 writable bits all default  to  zero  at  power-up/reset.
  2450.                 They must remain zero except when writing test vectors.
  2451.    Size:        16 bits
  2452.    Bit Description:
  2453.  
  2454.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2455.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2456.        | Attempt Count |  testo[3..0]  |          testi[7..0]          |
  2457.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2458.  
  2459.         Bits 15-12      Attempt counter. Incremented on each collision.
  2460.         Bit 11          Ethernet Controller testo[3] (read only).
  2461.         Bit 10          Ethernet Controller testo[2] (read only).
  2462.         Bit 9           Ethernet Controller testo[1] (read only).
  2463.         Bit 8           Ethernet Controller testo[0] (read only).
  2464.         Bit 7           Ethernet Controller testi[7].
  2465.         Bit 6           Ethernet Controller testi[6].
  2466.         Bit 5           Ethernet Controller testi[5].
  2467.         Bit 4           Ethernet Controller testi[4].
  2468.         Bit 3           Ethernet Controller testi[3].  Setting this
  2469.                         bit forces the random counter to 1, thereby
  2470.                         speeding up the retry time after a collision.
  2471.         Bit 2           Ethernet Controller testi[2].
  2472.         Bit 1           Ethernet Controller testi[1].  It also increases
  2473.                         the speed of an internal clock that times the
  2474.                         EEPROM accesses.
  2475.         Bit 0           Ethernet Controller testi[0].  It also increases
  2476.                         the speed of the timer and jabber counter.
  2477.  
  2478.    6.6.6 Ethernet Controller Status
  2479.  
  2480.    Function:    Provides access to Ethernet Controller status.
  2481.    Location:    Window 4/Port 08
  2482.    Size:        16 bits
  2483.    Bit Description:
  2484.  
  2485.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2486.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2487.        |TXD|TXR|TXU|TMC|TLC|TSE|TCA|TES|RRO|RXD|RFE|RXO|RFC|RDR|RXS|RXT|
  2488.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2489.  
  2490.         Bit 15  Ethernet Controller TX DONE(read only).
  2491.         Bit 14  Ethernet Controller TX RETRY (read only).
  2492.         Bit 13  Ethernet Controller TX UNDERRUN (read only).
  2493.         Bit 12  Ethernet Controller TX MAX COLL (read only).
  2494.         Bit 11  Ethernet Controller TX LATE COLL (read only).
  2495.         Bit 10  Ethernet Controller TX SQE ERR (read only).
  2496.         Bit 9   Ethernet Controller TX LCAR (read only).
  2497.         Bit 8   Ethernet Controller TX END SLT TIME (read only).
  2498.         Bit 7   Ethernet Controller RX REJECT OUT (read only).
  2499.         Bit 6   Ethernet Controller RX DONE (read only).
  2500.         Bit 5   Ethernet Controller RX FRAME ERR (read only).
  2501.         Bit 4   Ethernet Controller RX OVERRUN (read only).
  2502.         Bit 3   Ethernet Controller RX FCS ERR (read only).
  2503.         Bit 2   Ethernet Controller RX DRIBBLE (read only).
  2504.         Bit 1   Ethernet Controller RX SHORT (read only).
  2505.         Bit 0   Ethernet Controller RX TESTEN (read/write).
  2506.  
  2507.  
  2508.            3Com 3C509 and 3C509-TP Technical Reference Guide        6-19
  2509.  
  2510. Chapter 7
  2511. Adapter Configuration and Enable
  2512.  
  2513.    The  3C509  adapter  supports  a  variety  of  configuration  options
  2514.    controlled by a set of configuration registers.  It also supports two
  2515.    adapter activation mechanisms, one for ISA machines and the other for
  2516.    EISA machines.
  2517.  
  2518.    NOTE: Once activated, the adapter can be deactivated only by a Global
  2519.    Reset command.
  2520.  
  2521.  
  2522.    7.1 Automatic Configuration at Power-on Reset
  2523.  
  2524.    After reset (power-on reset,  Configuration Control  register bit  2,
  2525.    Global Reset command, or ID Global Reset command) the adapter  copies
  2526.    the eighth, ninth, and third  words of  the EEPROM  into the  Address
  2527.    Configuration register, the Resource Configuration register, and  the
  2528.    Product ID register.  The I/O  base  address  configuration  is  also
  2529.    written at this time.
  2530.  
  2531.    NOTE: The driver software is  responsible  for  reading  the  station
  2532.    address  out  of  the  EEPROM  and  writing  it  into  the   Ethernet
  2533.    controller.
  2534.  
  2535.  
  2536.    7.2 ISA Activation Mechanism
  2537.  
  2538.    If the I/O base address configuration is set to an ISA base  address,
  2539.    then the ISA activation mechanism is selected.  In this mode,  memory
  2540.    read accesses to the  boot PROM  are always  enabled after  automatic
  2541.    configuration is completed,  but I/O  accesses to  the adapter's  I/O
  2542.    base address are disabled until  the ID Sequence State machine  (IDS)
  2543.    activates them.  See Figure 7-1.
  2544.  
  2545.           +--------+  +-------+  ID Complete  +------+          +------+
  2546.    Reset  |        |  |       |--------------->      | Activate |      |
  2547.    ------->AUTOINIT|-->ID_WAIT|               |ID_CMD|---------->ACTIVE|
  2548.           |        |  |       <---------------|      |          |      |
  2549.           +--------+  +-------+  ContendFail  +------+          +------+
  2550.                                  +TestFail
  2551.                                  +GotoWAIT
  2552.  
  2553.    Figure 7-1.  ID Sequence State Machine (IDS)
  2554.  
  2555.  
  2556.    WARNING: The adapter is not visible  to the software until after  the
  2557.    automatic  configuration  logic  has  finished  reading  the  adapter
  2558.    configuration EEPROM.  This takes  310 us  after a  global reset.   A
  2559.    global reset can be  caused by  power-on reset  (RESETDRV), a  Global
  2560.    Reset command written to the Command register (port 0E), an ID Global
  2561.    Reset command written  to the  ID command  port, or  setting the  RST
  2562.    (reset) bit (bit 2) in the Configuration Control register (port 04).
  2563.  
  2564.    After the automatic  configuration  completes,  the  IDS  is  in  its
  2565.    initial state (ID_WAIT) (see Figure  7-1), and it monitors all  write
  2566.    access to I/O port 01x0h,  where x is  any hex digit.   If a zero  is
  2567.    written to any one of  these ports, then  that address is  remembered
  2568.    and becomes the ID port.  A  second zero written to that port  resets
  2569.    the ID sequence  to its initial  state.  The IDS  watches for the  ID
  2570.    sequence to be written to the ID port.
  2571.  
  2572.  
  2573.  
  2574.            3Com 3C509 and 3C509-TP Technical Reference Guide         7-1
  2575.  
  2576.    The ID sequence is a sequence  of 255 bytes defined by the  following
  2577.    algorithm:
  2578.  
  2579.                 mov     cx,     0FFh
  2580.                 mov     dx,     IDport
  2581.                 mov     al,     0FFh
  2582.         @@1:    out     dx,     al
  2583.                 shl     al
  2584.                 jnc     @@2
  2585.                 xor     al,     0CFh
  2586.         @@2:    loop    @@1
  2587.  
  2588.    The sequence starts  with the value  0FFh and ends  with 98h (if  the
  2589.    adapter is in test mode, the  sequence  ends  with  69h,  the  eighth
  2590.    byte).  If at any  point  in  the  sequence  an  incorrect  value  is
  2591.    written, the sequence is reset to  its initial value of 0FFh.   Since
  2592.    the value zero never appears in  the  ID  sequence,  writing  a  zero
  2593.    always resets the sequencer and  the  ID  Port.   When  the  complete
  2594.    sequence has been written, the IDS enters the command state.
  2595.  
  2596.    In the ID_CMD state the IDS responds to both I/O reads and writes  to
  2597.    the ID port.  I/O writes to the ID port are interpreted as  commands.
  2598.    The following commands are supported:
  2599.  
  2600.    00 to 7F     Go to ID_WAIT state.  Wait for next ID sequence.
  2601.  
  2602.    80 to BF     Read EEPROM word n.  Address n  is the last six bits  of
  2603.                 the command.  EEPROM data is  read into the EEPROM  data
  2604.                 register .
  2605.  
  2606.    C0 to CF     Global Reset.  Resets  adapter  to  the  same  state  as
  2607.                 power- on reset (POR).
  2608.  
  2609.    D0 to D7     Set adapter tag register to n where n is last three bits
  2610.                 of the command.  If  adapter tag  register is  non-zero,
  2611.                 then the adapter will  not respond  to reads  of the  ID
  2612.                 port.  If the adapter tag register is non-zero, then the
  2613.                 adapter will ignore the commands in the D1 to D7 range.
  2614.  
  2615.    D8 to DF     Test adapter n where  n  is  the  last  3  bits  of  the
  2616.                 command.  If the adapter tag register is not equal to n,
  2617.                 then go to the ID_WAIT state else NOP.
  2618.  
  2619.    E0 to FE     Activate adapter,  write  the  last  five  bits  of  the
  2620.                 command  into  the  low   five  bits   of  the   Address
  2621.                 Configuration  register  that  controls  the  I/O   base
  2622.                 address, and return to the ID_WAIT state.
  2623.  
  2624.    FF           Activate the  adapter  at  the  preconfigured  I/O  base
  2625.                 address and return to the ID_WAIT state.
  2626.  
  2627.    In the ID_CMD state, I/O reads to  the  ID  port  are  treated  as  a
  2628.    contention test.  During a contention test, the adapter drives bit 15
  2629.    of the EEPROM Data register  out onto  bit 0  of the  host data  bus,
  2630.    using an open drain driver.   If there are  multiple adapters in  the
  2631.    system and one of them drives  out a "1" and  the other drives out  a
  2632.    "0," then both adapters and the host system will see (read) a "0"  on
  2633.    bit 0 of the host data bus.  At the end of the read cycle the adapter
  2634.    samples the data on bit 0 of the host data bus.  If the data does not
  2635.    match what was driven out, then the IDS has a contention failure  and
  2636.    returns to the ID_WAIT  state.  The EEPROM  Data register is  shifted
  2637.    (rotated) left  one  bit.   Meanwhile,  the  host  gets  one  bit  of
  2638.    configuration data in bit 0 of the AX Register with each read cycle.
  2639.  
  2640.            3Com 3C509 and 3C509-TP Technical Reference Guide         7-2
  2641.  
  2642.    This mechanism (ID_WAIT state and ID_CMD state) continues to function
  2643.    even after the adapter  is activated.   This means  the adapter  will
  2644.    respond to the software in the same way after either a cold boot or a
  2645.    warm boot.
  2646.  
  2647.    Use  the  following  algorithm  to  activate  a  particular  adapter,
  2648.    assuming multiple randomly configured  adapters  exist  in  the  host
  2649.    system.
  2650.  
  2651.    1.   Power-up system.
  2652.  
  2653.         All adapters auto-initialize and  then enter the ID_WAIT  state.
  2654.         In this state  the adapter  only responds  to writes  to the  ID
  2655.         port.  The ID port is the last I/O port in the range of 100h  to
  2656.         1FFh that has had a zero written to it.
  2657.  
  2658.    2.   Write two 0 bytes and then the ID sequence to the ID port.   All
  2659.         adapters enter the ID_CMD state.
  2660.  
  2661.    3.   Select EEPROM data to contend  on  by  writing  an  EEPROM  read
  2662.         command to the ID port.
  2663.  
  2664.    4.   Read the ID port 16 times.   Any adapter that gets a  contention
  2665.         failure will return to the ID_WAIT state.
  2666.  
  2667.    5.   Repeat steps 3 and 4 until contention criteria (station address,
  2668.         I/O base address, ROM base  address) have  been met  and only  a
  2669.         single adapter is left in the ID_CMD state.
  2670.  
  2671.  
  2672.    6.   Either tag the adapter with the  Set Tag command or activate the
  2673.         adapter with the Activate command.
  2674.  
  2675.    7.   Repeat steps 1 through 6 until the desired adapter is found  and
  2676.         activated.
  2677.  
  2678.    8.   Enable DRQ and IRQ drivers by setting the ENA (enable) bit  (bit
  2679.         0 of the Configuration Control register).
  2680.  
  2681.  
  2682.    7.3 EISA Activation Mechanism
  2683.  
  2684.    If  the  I/O  base   address  configuration  is   set  to  the   EISA
  2685.    slot-specific addressing mode, then the EISA activation mechanism  is
  2686.    selected.  After automatic configuration, the adapter will respond to
  2687.    I/O accesses in the range of xC80 to xC8F where the window 0 register
  2688.    set is always mapped.  The  EISA  motherboard  BIOS  will  check  the
  2689.    Manufacturer Code  and Product  ID registers,  overwrite the  Address
  2690.    Configuration and Resource Configuration registers, and then set  the
  2691.    Enable bit in  the  Configuration  Control  register  to  enable  the
  2692.    adapter.  Once enabled, the adapter  will respond to I/O accesses  in
  2693.    the range of x000 to x00F where the complete adapter register set  is
  2694.    mapped, to read access to its boot PROM address range (if any) and to
  2695.    enable the IRQ and DRQ drivers.   If the adapter is not installed  in
  2696.    an EISA machine, then the IDS state machine is still enabled (see the
  2697.    preceding section) and can be used instead.
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.            3Com 3C509 and 3C509-TP Technical Reference Guide         7-3
  2707.  
  2708.    7.4 Window 0 Register Set
  2709.  
  2710.    The window 0 register set  controls the configuration of the  adapter
  2711.    and provides access to the  adapter's EEPROM.  The window 0  register
  2712.    set correctly responds to both byte  and word I/O cycles.  Also,  the
  2713.    IRQ and DRQ drivers are disabled while window 0 is selected.
  2714.  
  2715.    7.4.1 Manufacturer Code Register (Read Only - Offset 0)
  2716.  
  2717.    This is the encoded form of 3Com's registered EISA manufacturer  code
  2718.    "TCM". The manufacturer code is stored in a byte-swapped format.
  2719.  
  2720.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2721.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2722.        |       6       |       D       |       5       |       0       |
  2723.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2724.  
  2725.    7.4.2 Product ID Register (Read Only - Offset 2)
  2726.  
  2727.    The automatic configuration logic  loads this register.  The  product
  2728.    number is stored in a byte-swapped format.
  2729.  
  2730.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2731.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2732.        |Product ID (lo)| Revision Code |      Product ID (hi)          |
  2733.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2734.  
  2735.    Product Number: The Product Number  is the binary coded decimal  3Com
  2736.    part  number  for  this  board.   When  this  changes,  a  new   EISA
  2737.    configuration file must be released.  The product ID is formed by the
  2738.    concatenation of Bits 7-0 and  Bits 15-12,  where Bits  7-4 form  the
  2739.    highest nibble and Bits 15-12 form the lowest nibble.
  2740.  
  2741.    Revision Code: The Revision  Code is a  4-bit adapter revision  code.
  2742.    Changes to this field do not  require  a  new  version  of  the  EISA
  2743.    configuration file.
  2744.  
  2745.    7.4.3 Configuration Control Register (Read/Write - Offset 4)
  2746.  
  2747.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2748.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2749.        | 0 | 0 |         PORreg        | 0 | 0 | 0 | 0 | 0 |RST| 0 |ENA|
  2750.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2751.  
  2752.    PORreg:      POR Jumper Register.   Lower six bits  of the RData  bus
  2753.                 latched at the deassertion  of  ResetPinIn.   PORreg  is
  2754.                 read only.
  2755.  
  2756.    Bit 13       0 = No AUI connector is available.
  2757.                 1 = AUI connector is available.
  2758.  
  2759.    Bit 12       0 = No on-board 10BASE2 transceiver is available.
  2760.                 1 = On-board 10BASE2 transceiver is available.
  2761.  
  2762.    Bits 11-10   0 = Reserved.
  2763.                 1 = Receive test mode (see IDS).
  2764.                 2 = Transmit test mode (see IDS).
  2765.                 3 = Normal operation mode.
  2766.  
  2767.    Bit 9        0 = No on-board 10BASE-T transceiver is available.
  2768.                 1 = On-board 10BASE-T transceiver is available.
  2769.  
  2770.  
  2771.  
  2772.            3Com 3C509 and 3C509-TP Technical Reference Guide         7-4
  2773.  
  2774.    Bit 8        0 = Use external encoder/decoder.
  2775.                 1 = Use internal encoder/decoder.
  2776.  
  2777.    Bit 2        RST (Reset adapter)
  2778.                 0 = Normal operation.
  2779.                 1 = Reset adapter to same state as POR.
  2780.  
  2781.    Bit 0        ENA (Enable adapter)
  2782.                 0 = Adapter disabled.  Disables DRQ and IRQ drivers.  In
  2783.                     EISA mode also disables boot PROM address decoding.
  2784.                 1 = Adapter enabled.
  2785.  
  2786.    7.4.4 Address Configuration Register (Read/Write - Offset 6)
  2787.  
  2788.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2789.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2790.        | XCVR  |ROM SIZ|    ROM BASE   | Reserved  |     I/O Base      |
  2791.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2792.  
  2793.    The automatic configuration logic loads this register.
  2794.  
  2795.    XCVR (Transceiver type select):
  2796.  
  2797.                 00 = Twisted-pair (10BASE-T) transceiver enabled.
  2798.                 01 = AUI port enabled.  Using external transceiver.
  2799.                 10 = Reserved - undefined.
  2800.                 11 = BNC (10BASE2) transceiver  enabled.   The  software
  2801.                      driver must  issue  a  Start  Internal  Transceiver
  2802.                      command to the Command register to start the DC- DC
  2803.                      converter.
  2804.  
  2805.    ROM SIZE:    Boot PROM window size.
  2806.  
  2807.    ROM BASE:    Boot PROM base address select.
  2808.  
  2809.    ROM Size        ROM Base        Effective Address Window
  2810.    --------        --------        ------------------------
  2811.       00             0000          Disable boot PROM
  2812.       00             0001          C2000h to C3FFFh
  2813.       00             0010          C4000h to C5FFFh
  2814.       00             0011          C6000h to C7FFFh
  2815.       00             0100          C8000h to C9FFFh
  2816.       00             0101          CA000h to CBFFFh
  2817.       00             0110          CC000h to CDFFFh
  2818.       00             0111          CE000h to CFFFFh
  2819.       00             1000          D0000h to D1FFFh
  2820.       00             1001          D2000h to D3FFFh
  2821.       00             1010          D4000h to D5FFFh
  2822.       00             1011          D6000h to D7FFFh
  2823.       00             1100          D8000h to D9FFFh
  2824.       00             1101          DA000h to DBFFFh
  2825.       00             1110          DC000h to DDFFFh
  2826.       00             1111          DE000h to DFFFFh
  2827.  
  2828.       01             0000          Disable boot PROM
  2829.       01             0001          C0000h to C3FFFh
  2830.       01             001x          C4000h to C7FFFh
  2831.       01             010x          C8000h to CBFFFh
  2832.       01             011x          CC000h to CFFFFh
  2833.       01             100x          D0000h to D3FFFh
  2834.       01             101x          D4000h to D7FFFh
  2835.       01             110x          D8000h to DBFFFh
  2836.       01             111x          DC000h to DFFFFh
  2837.  
  2838.            3Com 3C509 and 3C509-TP Technical Reference Guide         7-5
  2839.  
  2840.       10             0000          Disable boot PROM
  2841.       10             0001          C0000h to C7FFFh
  2842.       10             01xx          C8000h to CFFFFh
  2843.       10             10xx          D0000h to D7FFFh
  2844.       10             11xx          D8000h to DFFFFh
  2845.  
  2846.       11             0000          Disable boot PROM
  2847.       11             xxxx          Undefined - reserved
  2848.  
  2849.  
  2850.    I/O BASE (I/O base address):
  2851.                 0-30 (0h-1Eh) = Select ISA  mode  I/O  address  decode.
  2852.                                 I/O   base   address   =   value    (in
  2853.                                 hexadecimal) * 10h + 200h.
  2854.  
  2855.                 31 (1Fh) =      Select  EISA   mode  slot-specific   I/O
  2856.                                 address.  I/O base address  = x000 (x  =
  2857.                                 slot  number).   Window  0  also  always
  2858.                                 visible at xC80.
  2859.  
  2860.    7.4.5 Resource Configuration Register (Read/Write - Offset 8)
  2861.  
  2862.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2863.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2864.        |      IRQ      |       F       |           Reserved            |
  2865.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2866.  
  2867.    The automatic configuration logic loads this register.
  2868.  
  2869.    IRQ: Interrupt Request select (values given in decimal).
  2870.  
  2871.         {3,5,7,9,10,11,12,15} = Enable corresponding IRQ line driver.
  2872.         {0,1,2,4,6,8,13,14}   = Disable all IRQ line drivers.
  2873.  
  2874.    RES: Reserved
  2875.  
  2876.    7.4.6 EEPROM Command Register (Read/Write - Offset A)
  2877.  
  2878.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2879.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2880.        |EBY|TST|           |    TAG    |        EEPROM Command         |
  2881.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2882.  
  2883.    EBY: EEPROM Busy status (read only).
  2884.         0 = EEPROM not busy.
  2885.         1 = EEPROM busy.  I/O writes to the EEPROM command are disabled.
  2886.  
  2887.    TST: Test Mode (read only).  Set  at reset  time if  the EEPROM  data
  2888.         input pin is pulled low with external resistor to GND.  If  set,
  2889.         disables boot PROM.  Refer to  "Test Mode and Bad  Configuration
  2890.         Recovery," later in this chapter.
  2891.  
  2892.    TAG: Tag Register (read only).  Set by the ID Sequence State machine.
  2893.  
  2894.    EEPROM Command: Commands written here are shifted out to the on-board
  2895.         EEPROM.  There is  a 2-bit  op code  field and  a 6-bit  address
  2896.         field.  For all Erase and Write commands, the hardware times the
  2897.         10  ms  write  strobe   and  then  automatically  executes   the
  2898.         Erase/Write Disable command.
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.            3Com 3C509 and 3C509-TP Technical Reference Guide         7-6
  2905.  
  2906.    NOTE:  The  Erase/Write  Enable  command  provides  protection   from
  2907.    accidental writes to the EEPROM.   Software must wait for the  EEPROM
  2908.    Busy status bit to go off before writing the next command.
  2909.  
  2910.    Command             OP Code Address Data    Exe Time
  2911.    -------             ------- ------- ----    --------
  2912.    Read Register        10      a(5:0)  yes    162 us
  2913.    Write Register       01      a(5:0)  yes     11 ms
  2914.    Erase Register       11      a(5:0)  no      11 ms
  2915.    Erase/Write Enable   00      11xxxx  no      60 us
  2916.    Erase/Write Disable  00      00xxxx  no      60 us
  2917.    Erase All Registers  00      10xxxx  no      11 ms
  2918.    Write All Registers  00      01xxxx  yes     11 ms
  2919.  
  2920.    NOTE: The Erase commands write  all 1s  into the  EEPROM.  The  Write
  2921.    commands write only 0s.  To write data into an EEPROM word, you  must
  2922.    issue an Erase/Write Enable (EWEN) command, an Erase command, and  an
  2923.    EWEN command; load the data into the EEPROM Data register; and  issue
  2924.    a Write command.  Remember that you must verify that the EEPROM  Busy
  2925.    bit (EEPROM Command register bit 15)  is off (zero) before writing  a
  2926.    command to the EEPROM Command  register or  data to  the EEPROM  Data
  2927.    register.
  2928.  
  2929.    7.4.7 EEPROM Data Register (Read/Write - Offset C)
  2930.  
  2931.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2932.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2933.        |                          EEPROM Data                          |
  2934.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2935.  
  2936.    Write data must be written  to the  EEPROM Data  register before  the
  2937.    Write command is  given to the  EEPROM.  Read data  can be read  here
  2938.    after the EEPROM Busy  status bit  goes off.   The configuration  and
  2939.    driver software must be careful to  leave  the  Product  ID  in  this
  2940.    register  after  using  the  EEPROM.   Otherwise,  the  EISA   system
  2941.    configuration software will not be able to identify the adapter after
  2942.    a warm boot.
  2943.  
  2944.    7.4.8 Command Register (Read/Write - Offset E)
  2945.  
  2946.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  2947.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2948.        |                            Command                            |
  2949.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  2950.  
  2951.    The only valid commands in  Window 0  are Window  commands to  select
  2952.    another window.
  2953.  
  2954.  
  2955.    7.5 Test Mode and "Bad" Configuration Recovery
  2956.  
  2957.    It  is  the  responsibility   of  the  user   (with  help  from   the
  2958.    configuration program) to avoid configuring  the  boot  PROM  on  the
  2959.    adapter in such a way that the  system is not able to boot.  If  this
  2960.    does occur, you can manually jumper Test Via using a #2 pencil.   The
  2961.    Test Via forces the adapter  into test mode  which disables the  boot
  2962.    PROM so that the adapter configuration program can be run.  You  must
  2963.    cover the designated area thoroughly with the pencil.
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.            3Com 3C509 and 3C509-TP Technical Reference Guide         7-7
  2971.  
  2972.    Test  mode  forces   the  adapter  not   to  perform  the   Automatic
  2973.    Initialization sequence, which means the  EEPROM is not read and  the
  2974.    adapter is left in the following configuration:
  2975.  
  2976.       - Address Configuration register = 0000h
  2977.       - Resource Configuration register = 0000h
  2978.       - Product ID register = 0000h
  2979.  
  2980.    Test mode also shortens  the ID sequence to  8 bytes (first is  still
  2981.    FFh and last is 69h) and forces it to the active state (that is,  the
  2982.    adapter is active  and will  respond to  I/O cycles  at base  address
  2983.    0200h even without going through the ID sequence).
  2984.  
  2985.    After you are done, thoroughly erase the pencil mark.
  2986.  
  2987.  
  2988.    7.6 EEPROM Data Structure
  2989.  
  2990.    Offset          Field Name                 Default (Hex)
  2991.    ------          ----------                 -------------
  2992.    00              3Com Node Address (word 0)      0060
  2993.    01              3Com Node Address (word 1)      8CXX
  2994.    02              3Com Node Address (word 2)      XXXX
  2995.    03              3C509 Product ID                9X50
  2996.    04              Manufacturing Data (date)*      XXXX
  2997.    05              Manufacturing Data              XXXX
  2998.    06              Manufacturing Data              XXXX
  2999.    07              Manufacturer Code (6D50h)       6D50
  3000.  
  3001.    08              Address Configuration           XXXX
  3002.    09              Resource Configuration          XXXX
  3003.    0A              OEM Node Address (word 0)       0060
  3004.    0B              OEM Node Address (word 1)       8CXX
  3005.    0C              OEM Node Address (word 2)       XXXX
  3006.    0D              Software Information            XXXX
  3007.    0E              Reserved                        XXXX
  3008.    0F              Checksum                        XXXX
  3009.  
  3010.    10 to 3F        Network Management Data         XXXX
  3011.  
  3012.    "X" represents a value that may vary from adapter to adapter.
  3013.  
  3014.    * Manufacturing date format:
  3015.  
  3016.         15  14  13  12  11  10   9   8   7   6   5   4   3   2   1   0
  3017.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  3018.        |           Year            |     Month     |       Day         |
  3019.        +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  3020.  
  3021.       - Year is 0 through 99 and  represents the last two digits of  the
  3022.         current year.
  3023.       - Month is 1 through 12.
  3024.       - Day is 1 through 31.
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.            3Com 3C509 and 3C509-TP Technical Reference Guide         7-8
  3037.  
  3038. Chapter 8
  3039. ISA/EISA Bus Interface
  3040.  
  3041.  
  3042.    8.1 Supported Slot Types and Cycle Types
  3043.  
  3044.    8.1.1 16-bit ISA Slot
  3045.  
  3046.    The 3C509 adapter supports 8-bit and 16-bit I/O cycles.  It  supports
  3047.    8-bit and 16-bit memory read  cycles as  an 8-bit  adapter (does  not
  3048.    assert MEMCS16).  It  only supports default  timing (does not  assert
  3049.    0WS or de-assert  IOCHRDY) as  specified in  the technical  reference
  3050.    guide for the IBM (R) Personal Computer AT (R).
  3051.  
  3052.    8.1.2 EISA Slot
  3053.  
  3054.    The 3C509 adapter supports 8-bit and 16-bit I/O cycles.  It  supports
  3055.    8-bit and 16-bit memory read cycles as an 8-bit ISA adapter.  It only
  3056.    supports default timing  as  specified  in  the  EISA  specification,
  3057.    version 3.10, section 2.11.4.1 ISA-compatible Timing Parameters.
  3058.  
  3059.  
  3060.    8.2 DC Characteristics - Pin Drive/Load Types
  3061.  
  3062.    Type    3SH     3SL     OC      BI      IN      IN2     Units
  3063.    ----    ---     ---     --      --      --      ---     -----
  3064.    Voh     2.4     2.4     -       2.4                     min Volts
  3065.    Vol     0.4     0.4     0.4     0.4                     max Volts
  3066.    Ioh     3.0     0.4     -       3.0                     max mAmps
  3067.    Iol     24.0    5.0     24.0    24.0                    max mAmps
  3068.    Vih                             2.0     2.0     2.0     min Volts
  3069.    Vil                             0.8     0.8     0.8     max Volts
  3070.    Iih                             10.0    10.0    20.0    max uAmps
  3071.    Iil                             10.0    10.0    20.0    max uAmps
  3072.    Icap    15      15      15      15      15      15      max pF
  3073.  
  3074.  
  3075.    8.3 Board Edge Connector Pins
  3076.  
  3077.    Pin No. Pin Name   Description             Type        Notes
  3078.    ------- --------   -----------             ----        -----
  3079.    A2-9    SD7-0      Low byte data bus       BI
  3080.    A11     AEN        Address enable          IN
  3081.    A12-15  SA19-16    Latched address bus     I
  3082.    A16-31  SA15-0     Latched address bus     IN2             2
  3083.  
  3084.    B2      RESETDRV   Power-on reset          IN
  3085.    B4      IRQ9       Interrupt request 9     3SH             1
  3086.    B12     SMEMR-     Memory read strobe      IN
  3087.    B13     IOW-       I/O write strobe        IN
  3088.    B14     IOR-       I/O read strobe         IN
  3089.    B21     IRQ7       Interrupt request 7     3SH             1
  3090.    B23     IRQ5       Interrupt request 5     3SH             1
  3091.    B25     IRQ3       Interrupt request 3     3SH             1
  3092.    B27     T/C        Not Used                IN
  3093.  
  3094.    C1      SBHE-      High-byte enable        IN
  3095.    C11-18  SD8-15     High-byte data bus      BI
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.            3Com 3C509 and 3C509-TP Technical Reference Guide         8-1
  3103.  
  3104.    D2      IOCS16-    16-bit I/O select       OC
  3105.    D3      IRQ10      Interrupt request 10    3SH             1
  3106.    D4      IRQ11      Interrupt request 11    3SH             1
  3107.    D5      IRQ12      Interrupt request 12    3SH             1
  3108.    D6      IRQ15      Interrupt request 15    3SH             1
  3109.    D10     DACK5-     Not Used                IN
  3110.    D11     DRQ5       Not Used                3SH
  3111.    D12     DACK6-     Not Used                IN
  3112.    D13     DRQ6       Not Used                3SH
  3113.    D14     DACK7-     Not Used                IN
  3114.    D15     DRQ7       Not Used                3SH
  3115.  
  3116.    B1,B10,B31,D18     GND
  3117.    B3,B29,D16         +5 volts @ .4 amp max.                  3
  3118.    B9                 +12 volts @ .5 amp max.                 4
  3119.  
  3120.    NOTES:
  3121.  
  3122.    1. Although both the IBM  technical  reference  guide  and  the  EISA
  3123.       specification specify an open collector driver on the IRQ signals,
  3124.       you cannot assume there  will be a  reasonable pullup resistor  on
  3125.       these lines in all ISA  machines.   The  3C509  adapter  will  use
  3126.       tri-state drivers on these lines and drive the selected IRQ signal
  3127.       high (similar to  3Com's EtherLink  (R) 16  adapter).  This  means
  3128.       that the 3C509 adapter does not support shared interrupts.
  3129.  
  3130.    2. SA15-0 are the only bus interface signals that go to more than one
  3131.       IC pin on the 3C509 adapter.  They are connected to both the 3C509
  3132.       ASIC and the boot PROM address pins.
  3133.  
  3134.    3. Max +5V current           150 mAmps
  3135.  
  3136.    4. Max +12V current standby    0 mAmps
  3137.       10BASE-T transceiver on     0 mAmps
  3138.       10BASE2 transceiver on    300 mAmps
  3139.       External transceiver on   500 mAmps
  3140.  
  3141.  
  3142.  
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.            3Com 3C509 and 3C509-TP Technical Reference Guide         8-2
  3169.  
  3170. Chapter 9
  3171. External Configuration Options
  3172.  
  3173.    The 3C509 ASIC supports a  wide  variety  of  external  configuration
  3174.    options.  These options are available to support board-level  testing
  3175.    and notify the ASIC and the host software of media resource support.
  3176.  
  3177.  
  3178.    9.1 Boundary Scan Configuration
  3179.  
  3180.    When the ResetPinIn is asserted, a boundary scan ring is given access
  3181.    to the ASIC's I/O pins.  RData[7:4]  acts as the control port to  the
  3182.    boundary scan with the following functionality:
  3183.  
  3184.    Bit        Function        I/O
  3185.    ---        --------        ---
  3186.    RData[7]   DataIn          Input
  3187.    RData[6]   DataOut         Output
  3188.    RData[5]   BClk            Input
  3189.    RData[4]   Shift/!Load     Input
  3190.  
  3191.    Listed below are the I/O  pins available to  boundary scan and  their
  3192.    functionality with respect to the ASIC.
  3193.  
  3194.    Inputs          Outputs
  3195.    ------          -------
  3196.    SBHE_           DRQ[7:5]
  3197.    AENA            EEDataO
  3198.    IOR_            EEClockO
  3199.    IOW_            IOCS16_
  3200.    SMRD_           LEDDrvO_
  3201.    SAIn[19:0]      IRQ[15, 12:9, 7, 5, 3]
  3202.    EEPROMDIn
  3203.    SData[15:0]
  3204.  
  3205.  
  3206.    9.2 Forced Configuration
  3207.  
  3208.    The EEPROMDIn pin is sampled at the falling edge of ResetPinIn.   The
  3209.    ASIC is configured with an I/O base address of 200h, the boot PROM is
  3210.    disabled,   and   the    internal   10BASE-T   transceiver    enabled
  3211.    (independently of the availability of this resource).  This option is
  3212.    exercised at board-level test, and  can be used  in extreme cases  by
  3213.    customers if the 3C509 ASIC is incorrectly configured in a machine.
  3214.  
  3215.  
  3216.    9.3 Physical Layer Configuration
  3217.  
  3218.    RData[5:0] are used to notify the 3C509 ASIC of its external physical
  3219.    layer resources.   As  with  forced  configuration,  these  pins  are
  3220.    sampled on the falling edge of ResetPinIn, and various configurations
  3221.    are strapped via pulldown resistors on the PC board.
  3222.  
  3223.    NOTE: These configurations must not be modified by the end user.
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.            3Com 3C509 and 3C509-TP Technical Reference Guide         9-1
  3235.  
  3236.    Physical layer resources are encoded as follows:
  3237.  
  3238.    RData   Resources Available
  3239.    -----   -------------------
  3240.    0       Internal encoder/decoder
  3241.    1       10BASE-T transceiver (through internal interface)
  3242.    2       See "Physical Layer Test Access" (below)
  3243.    3       See "Physical Layer Test Access" (below)
  3244.    4       10BASE2 transceiver (through AUI and DC-DC converter)
  3245.    5       15-pin AUI connector
  3246.  
  3247.    Except for the  external encoder/decoder  configuration, an  internal
  3248.    AUI transceiver is available in all configurations.
  3249.  
  3250.    NOTE: The  external  encoder/decoder  configuration  is  for  testing
  3251.    purposes only.
  3252.  
  3253.    9.4 Physical Layer Test Access
  3254.  
  3255.    RData[3:2] (as sampled at  the  falling  edge  of  ResetPinIn)  allow
  3256.    access to the physical layer  for test purposes.  The various  access
  3257.    ports are windowed to the RData[7:0] bus, and are listed below.
  3258.  
  3259.    Pin 3   Pin 2   Mode
  3260.    -----   -----   ----
  3261.    0       0       Reserved
  3262.    0       1       Receive Physical Access
  3263.    1       0       Transmit Physical Access
  3264.    1       1       Normal EEPROM Access (Default)
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.            3Com 3C509 and 3C509-TP Technical Reference Guide         9-2
  3301.